/// <summary> /// 更新主界面的QQ好友列表 /// </summary> internal void ReNewListBoxFriend() { listBoxFriend.Items.Clear(); foreach (KeyValuePair <string, SmartQQ.FriendInfo> FriendList in SmartQQ.FriendList) { listBoxFriend.Items.Add(FriendList.Key + ":" + SmartQQ.Info_RealQQ(FriendList.Key) + ":" + FriendList.Value.nick); } }
private void buttonSend_Click(object sender, EventArgs e) { if ((textBoxSendMessage.Text.Equals("")) || (!(IsFriendSelent || IsGroupSelent))) { return; } if (IsGroupSelent && listBoxGroup.SelectedItem != null) { string GName = ""; string[] tmp = listBoxGroup.SelectedItem.ToString().Split(':'); string MessageToSend = textBoxSendMessage.Text; SmartQQ.Message_Send(1, tmp[0], MessageToSend); if (SmartQQ.GroupList.ContainsKey(tmp[0])) { GName = SmartQQ.GroupList[tmp[0]].name; } AddTextToTextBoxResiveMessage("发送至 " + GName + Environment.NewLine + textBoxSendMessage.Text); } else if (IsFriendSelent && listBoxFriend.SelectedItem != null) { string Nick = ""; string[] tmp = listBoxFriend.SelectedItem.ToString().Split(':'); string MessageToSend = textBoxSendMessage.Text; SmartQQ.Message_Send(0, tmp[0], MessageToSend); if (SmartQQ.FriendList.ContainsKey(tmp[0])) { Nick = SmartQQ.FriendList[tmp[0]].nick; } AddTextToTextBoxResiveMessage("发送至 " + Nick + " " + SmartQQ.Info_RealQQ(tmp[0]) + Environment.NewLine + textBoxSendMessage.Text); } textBoxSendMessage.Clear(); }