private void WinClient_Load(object sender, EventArgs e) { if (!TalkService.Connect(RConfig.ReadString("Host"), RConfig.ReadInt("Port"))) { MessageBox.Show("无法连接服务器"); Application.Exit(); return; } LogAction.LogOut += LogAction_LogOut; //注册事件 TalkService.ClientCall.MessageShowEvent += MessageShow; TalkService.ClientCall.UpdateUserListEvent += UpdateUserList; LogOn tmp = new LogOn(); tmp.ShowDialog(); if (!tmp.IsLogOn) { Application.Exit(); } }
private void WinClient_Load(object sender, EventArgs e) { if (!TalkService.Connect(RConfig.ReadString("Host"), RConfig.ReadInt("Port"))) { MessageBox.Show("无法连接服务器"); Application.Exit(); return; } TalkService.Client.RegModule(this); LogAction.LogOut += LogAction_LogOut; LogOn tmp = new LogOn(); tmp.ShowDialog(); if (!tmp.IsLogOn) { Application.Exit(); } }