获取当前登录的QQ号码(C#)
private void button1_Click(object sender, EventArgs e) { if(web.ReadyState != WebBrowserReadyState.Complete){ MessageBox.Show("网页尚未加载完毕,请稍等."); return; } lvwUins.Items.Clear(); HtmlDocument doc = web.Document; HtmlElement uinList = doc.GetElementById("list_uin"); if(uinList != null){ for (int i = 0; i < uinList.Children.Count; i++) { string str = uinList.Children[i].InnerText.Trim(); //分割昵称和QQ号码 string[] temp = str.Split(' '); string nick = temp[0]; string uin = temp[1]; //去除括号 uin = uin.Replace("(", "").Replace(")", ""); ListViewItem item = new ListViewItem(); item.Text = nick; item.SubItems.Add(uin); lvwUins.Items.Add(item); } } }
源码,请联系QQ:1952300797