public void WatchConnection() { bool internetConnection = ConnectWatch.WatchInternet(); bool cumtConnection = ConnectWatch.WatchCumtStu(); String current = internetConnection ? "已联网" : (cumtConnection ? "未登录" : "未连接至校园网"); Console.WriteLine("watchConnection method:" + current); Thread.Sleep(5000); }
private void CheckForUpdate_Click(object sender, EventArgs e) //检查更新 { /* * MessageDialog dialog = new MessageDialog(); * dialog.MessageLabel_Dialog.Text = "还没有更新哦!"; * dialog.Text = "检查更新"; * dialog.ShowDialog(); */ bool result1 = ConnectWatch.WatchInternet(); bool result2 = ConnectWatch.WatchCumtStu(); Console.WriteLine("internet:" + result1); Console.WriteLine("cumt:" + result2); }