日期:2014-05-18 浏览次数:21231 次
private void tim_icon_Tick(object sender, EventArgs e) {if (sys_UserID != "" && sys_UserID != null) { XmlDocument xmldoc = new XmlDocument(); xmldoc.Load("http://localhost:3711/WebMiddle/ChatList.aspx?uid=" + sys_UserID + "&fsid=" + sys_fsid + "&hash=" + chkHash); XmlNodeList lists = xmldoc.SelectNodes("/root/names"); if (lists.Count > 0) { ToolStripMenuItem item = null; foreach (XmlNode xn in lists) { item = new ToolStripMenuItem(); item.Name = "chatuser_" + xn.ChildNodes[2].InnerText.ToString() + "-" + xn.ChildNodes[1].InnerText.ToString(); item.Text = xn.ChildNodes[0].InnerText.ToString() + " (" + xn.ChildNodes[3].InnerText.ToString() + ")"; item.Click += new EventHandler(contextList_item_Click); item.Size = new System.Drawing.Size(100, 50); contextList.Items.Add(item); } } }