/// <summary> /// 初始化连接 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void FormLogin_Load(object sender, EventArgs e) { KaixinHelper.Init(); // System.Threading.Thread.Sleep(3000); bool isInit = KaixinHelper.Init(); if (isInit == false) { MessageBox.Show("连接网络出错,请确认网络正常!"); this.Dispose(); } else { StreamReader sr = new StreamReader(Application.StartupPath + "\\user", System.Text.Encoding.UTF8); string content = sr.ReadToEnd(); sr.Close(); sr.Dispose(); content = Encrypt.DecryptDES(content, "19880808"); if (content != "") { txtUserName.Text = content.Substring(0, content.IndexOf("\n")); txtPassword.Text = content.Substring(content.IndexOf("\n") + 1, content.Length - (content.IndexOf("\n") + 1)); chkSave.Checked = true; } } }
private void FormFriend_Load(object sender, EventArgs e) { Program.formLogin.Hide(); //隐藏登录窗体 kh = new KaixinHelper(); LoadFriendsThread.Start(); //if ((LoadFriendsThread.ThreadState & ThreadState.Running) == ThreadState.Running) // LoadFriendsThread.Abort(); //LoadFriendsThread = null; }