/// <summary> /// 登录窗体登录返回事件 /// </summary> /// <param name="user"></param> private void login_Login_Event(User user) { XmppCon.Username = user.UserName; XmppCon.Password = user.PassWord; waiting = new LoginWaiting(); try { waiting.Show(); } catch (Exception) { } Document doc_login = new Document(); Settings.Verify settings = new Settings.Verify(); doc_login.LoadFile(CSS.IM.UI.Util.Path.SettingsFilename); Settings.ServerInfo serverInfo = serverInfo = doc_login.RootElement.SelectSingleElement(typeof(Settings.ServerInfo)) as Settings.ServerInfo; if (serverInfo.ServerPort == null || serverInfo.ServerIP == null) { MsgBox.Show(waiting, "CSS&IM", "服务器地址错误!", MessageBoxButtons.OK); waiting.Hide(); LogOut(false, false); return; } XmppCon.Port = int.Parse(serverInfo.ServerPort.ToString()); XmppCon.Server = serverInfo.ServerIP; this.Hide(); this.ShowInTaskbar = false; new Thread(new ThreadStart(OpenSocket)).Start(); }
/// <summary> /// 登录窗体登录返回事件 /// </summary> /// <param name="user"></param> private void login_Login_Event(User user) { login_user = user;//保存登陆成功后的用户 XmppCon.Username = user.UserName; XmppCon.Password = user.PassWord; waiting = new LoginWaiting(); try { waiting.Show(); } catch (Exception) { } if (Program.ServerIP == null || Program.Port == null) { MsgBox.Show(waiting, "CSS&IM", "服务器地址错误!", MessageBoxButtons.OK); waiting.Hide(); LogOut(false, false); return; } XmppCon.Port = int.Parse(Program.Port); XmppCon.Server =Program.ServerIP; this.Hide(); this.ShowInTaskbar = false; new Thread(new ThreadStart(OpenSocket)).Start(); }