private void Main_Load(object sender, EventArgs e) { lbMeInfo.Text = wxrb._me.NickName + "\n\r" + wxrb._me.UserName; //System.Net.WebRequest webreq = System.Net.WebRequest.Create( wxrb._me.HeadImgUrl); //System.Net.WebResponse webres = webreq.GetResponse(); //using(System.IO.Stream stream = webres.GetResponseStream()) //{ // pbMeImg.Image = Image.FromStream(stream); //} //获取联系人 wxrb.get_contact(); for (int i = 0; i < wxrb.contact_list.Count; i++) { MetroTile tile = new MetroTile(); tile.Width = 280; tile.Height = 60; tile.Name = wxrb.contact_list[i].UserName; var remarkName = wxrb.contact_list[i].RemarkName; var nickName = wxrb.contact_list[i].NickName; tile.Text = remarkName == ""?nickName:remarkName; tile.Location = new Point(0, (tile.Height + 5) * i); tile.TileCount = i + 1; metroPanel2.Controls.Add(tile); } backgroundWorker1.RunWorkerAsync(); }
private void Main_Load(object sender, EventArgs e) { mcbTulingRobot.Checked = CSHelper.ReadINI("setup", "robot_switch", path) == "1"; txtApiKey.Text = CSHelper.ReadINI("setup", "tuling_key", path); txtBotName.Text = CSHelper.ReadINI("setup", "bot_name", path); lbMeInfo.Text = wxrb._me.NickName + "\n\r" + wxrb._me.UserName; //System.Net.WebRequest webreq = System.Net.WebRequest.Create( wxrb._me.HeadImgUrl); //System.Net.WebResponse webres = webreq.GetResponse(); //using(System.IO.Stream stream = webres.GetResponseStream()) //{ // pbMeImg.Image = Image.FromStream(stream); //} //获取联系人 wxrb.get_contact(); for (int i = 0; i < wxrb.contact_list.Count; i++) { MetroTile tile = new MetroTile(); tile.Width = 280; tile.Height = 60; tile.Name = wxrb.contact_list[i].UserName; var remarkName = wxrb.contact_list[i].RemarkName; var nickName = wxrb.contact_list[i].NickName; tile.Text = remarkName == ""?nickName:remarkName; tile.Location = new Point(0, (tile.Height + 5) * i); tile.TileCount = i + 1; tile.Click += TileContactList_Click; metroPanel2.Controls.Add(tile); } backgroundWorker1.RunWorkerAsync(); }