private void SkinButton4_Click(object sender, EventArgs e) //## 断开连接函数 { if (!LoginInternet.checkInternetLink()) { return; } LoginBW.Url = new Uri("http://down.gwifi.com.cn/"); while (LoginBW.ReadyState != WebBrowserReadyState.Complete) { System.Windows.Forms.Application.DoEvents(); } IHTMLDocument2 id2 = LoginBW.Document.DomDocument as IHTMLDocument2; IHTMLWindow2 win = id2.parentWindow; try { win.execScript("loginout()", "javascript"); } finally { GiwifiReg.unALLsettingregedt32(); } //timeOut(2000); LoginBW.Url = new Uri("http://down.gwifi.com.cn/"); while (LoginBW.ReadyState != WebBrowserReadyState.Complete) { System.Windows.Forms.Application.DoEvents(); } InternetLight(); // 刷新 GiwifiReg.unALLsettingregedt32(); }
private void LoginLongCheck_Tick(object sender, EventArgs e) //## 延时缓冲判断连接成功函数 解决误判 无法连接。 { if (--Xtime <= 0) { Xtime = 20; LoginLongCheck.Enabled = false; return; } if (LoginInternet.checkInternetLink()) { InternetLight(); LoginLongCheck.Enabled = false; } }
private void InternetLight() // ## 主页的连接灯 绿色代表已经连接上 红色代表无法连接 仅有在无法连接的条件下才能执行连接按钮。 { if (LoginInternet.checkInternetLink()) { label3.BackColor = Color.Aquamarine; label4.ForeColor = Color.Green; label4.Text = "连接成功"; } else { label3.BackColor = Color.Crimson; label4.ForeColor = Color.Red; label4.Text = "未连接"; } }
private void SkinButton1_Click(object sender, EventArgs e) //## 执行连接的按钮 { //HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NlaSvc\Parameters\Internet\EnableActiveProbing GiwifiReg.settingregedt32(@"SYSTEM\CurrentControlSet\Services\NlaSvc\Parameters\Internet\", "EnableActiveProbing", 0); if (LoginInternet.checkInternetLink()) { return; } //## 检查连接情况 if (client.Interfaces[0].NetworkInterface.OperationalStatus == OperationalStatus.Down) //System.Net.NetworkInformationd.Op { linkNetworkWifi(); // 发出连接请求,未必就连上了 因此 254行出现误报情况就是这样的。所以要设置三状态 对未配置 已配置 占位配置 登出 和 登入要有安排 } Logingiwifiuser(); // 执行连接 LoginLongCheck.Enabled = true; // 执行时钟扫描 防止误报连接情况 SettingNowLoading(); GiwifiReg.unALLsettingregedt32(); }