public JObject WxInit() { string init_json = "{{"BaseRequest":{{"Uin":"{0}","Sid":"{1}","Skey":"","DeviceID":"e1615250492"}}}}"; Cookie sid = BaseService.GetCookie优艾设计网_Photoshop交流("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()); //已添加了具有相同键的项 求帮忙下,我是在winform想实现 } 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)); }
360U3184593347 2022-06-25 08:4优艾设计网_设计百科5
_syncKey[synckey["Key"].ToString()] = synckey["Val"].ToString();
这样改动的话,后面获取到的信息会覆盖掉之前的信息
ericleung001 2022-06-25 09:07优艾设计网_Photoshop论坛
_syncKey.Add(synckey["Key"].ToString(), synckey["Val"].ToString());
改成
ty_115634936 2022-06-25 09:11 优艾设计网_Photoshop论坛
_syncKey
是字典对象吗?
精彩评论