Пример #1
0
 //恢复本机默认IP
 private void RestoreOriginIP()
 {
     //return;
     if (NetworkSetting.isDHCPEnabled())
     {
         NetworkSetting.EnableDHCP();
     }
     else
     {
         NetworkSetting.SetIPAddress(ipOrigin, "255.255.255.0", gatewayOrigin);
         //NetworkSetting.SetDNS(new string[] { dnsOrigin, "8.8.8.8" });
     }
 }
Пример #2
0
 private void btnIPVote_Click(object sender, EventArgs e)
 {
     if (!flagIpVoteStart)//进入刷票模式
     {
         if (NetworkSetting.isDHCPEnabled())
         {
             //MessageBox.Show();
             OutMsg("当前为DHCP模式,可能不支持!");
             //return;
         }
         succCount     = 0;
         failCount     = 0;
         ipTestedCount = 0;
         ipTotalCount  = 0;
         if (ipListMain != null)
         {
             ipListMain.Clear();
         }
         SetIpVoteBtnState(true);
         thIpVote = new Thread(new ThreadStart(thIpVote_DoWork));
         thIpVote.IsBackground = true;
         thIpVote.Start();
         OutMsg("开始刷票...");
     }
     else
     {
         if (sender != null)//手点的按钮,不再运行第二次
         {
             flagOnceMore = false;
         }
         //bw.CancelAsync();
         SetIpVoteBtnState(false);
         OutMsg("正在停止...");
         btnIPVote.Enabled = false;
     }
 }