public JObject WxInit() { string init_json = "{{"BaseRequest":{{"Uin":"{0}","Sid":"{1}","Skey":"","DeviceID":"e1615250492"}}}}"; Cookie sid = BaseService.GetCookie("wxsid"); Cookie uin = BaseService.GetCookie("wxuin");if (sid != null && uin != null) { init_json = string.Format(init_json, uin.Value, sid.Value); byte[] bytes = BaseService.SendPostRequest(_init_url + "&pass_ticket=" + LoginService.Pass_Ticket, init_json); string init_str = Encoding.UTF8.GetString(bytes);JObject init_result = JsonConvert.DeserializeObject(init_str) as JObject;foreach (JObject synckey in init_result["SyncKey"]["List"])//同步鍵值 {_syncKey.Add(synckey["Key"].ToString(), synckey["Val"].ToString()); //已添加了具有相同鍵的項(xiàng) 求幫忙下,我是在winform想實(shí)現(xiàn) } return init_result; } else { return null; } } /// <summary> /// 獲取好友頭像 /// </summary> /// <param name="username"></param> /// <returns></returns> public Image GetIcon(string username) { byte[] bytes = BaseService.SendGetRequest(_geticon_url + username); return Image.FromStream(new MemoryStream(bytes)); } /// <summary> /// 獲取微信討論組頭像 /// </summary> /// <param name="usename"></param> /// <returns></returns> public Image GetHeadImg(string usename) { byte[] bytes = BaseService.SendGetRequest(_getheadimg_url + usename);return Image.FromStream(new MemoryStream(bytes)); }