diff --git a/Interact/Client.cs b/Interact/Client.cs index d782ff0..35aa041 100644 --- a/Interact/Client.cs +++ b/Interact/Client.cs @@ -80,7 +80,7 @@ namespace Interact return false; } - workingDictionary.Clear(); //清空临时记录 + workingDictionary?.Clear(); //清空临时记录 if (sendLoopThread != null) sendLoopThread.Abort(); if (readLoopThread != null) diff --git a/StormChatWPF/Chat.cs b/StormChatWPF/Chat.cs index e67a055..67a49b9 100644 --- a/StormChatWPF/Chat.cs +++ b/StormChatWPF/Chat.cs @@ -19,20 +19,8 @@ namespace StormChatWPF StormClient.OnGetUserListDone += GetContactsList; StormClient.OnMessage +=ReciveMessage; } + internal User SetContact { get; set; }//设置当前联系人对象 - - private User ChatNow; - internal User SetContact - { - get - { - return ChatNow; - } - set - { - ChatNow = value; - } - }//设置当前联系人对象 internal static void GetContactsList(ResultHead head, User[] users) { if (head.Error != "") @@ -47,7 +35,10 @@ namespace StormChatWPF { if (StormClient.Initialize()) { - StormClient.QueueLogin(user,password); + if (!StormClient.QueueLogin(user, password)) + { + MessageBox.Show("登录失败"); + } } else { @@ -68,7 +59,7 @@ namespace StormChatWPF } else { - MessageBox.Show("登录失败!"); + MessageBox.Show("请核对账号密码!"); } }); }//登录完成 diff --git a/StormChatWPF/LogWindow.xaml b/StormChatWPF/LogWindow.xaml index efe8c9a..ed4a88f 100644 --- a/StormChatWPF/LogWindow.xaml +++ b/StormChatWPF/LogWindow.xaml @@ -5,13 +5,25 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:StormChatWPF" mc:Ignorable="d" - Title="MainWindow" Height="450" Width="800"> - - -