C # WebQQ protocol group robot (3)
Sometimes you need to add some functions by yourself. Here is a method.
When debugging webqq robots, I used google's F12 developer tool to capture network packets. Most of webqq's GET request parameters were used to GET the values obtained through Login2.
This method is used to obtain the user's real QQ. It seems useless. These are obtained by analyzing its network request.
Public string GetFriendQQ (string tuin) {string url = http://s.web2.qq.com/api/get_friend_uin2? Tuin = {$ tuin} & verifysession = & type = 1 & code = & vfwebqq = {$ vfwebqq} & t = 1409915278768; url = url. replace ({$ tuin}, tuin); url = url. replace ({$ tuin}, this. vfwebqq); HttpItem item = new HttpItem () {URL = url, Encoding = System. text. encoding. getEncoding (UTF-8), Method = get, IsToLower = false, Timeout = 100000, ReadWriteTimeout = 30000, Host = HOST [1], Referer = REFERER [1], userAgent = Mozilla/5.0 (Windows NT 6. 1; WOW64; rv: 18.0) Gecko/20100101 Firefox/18.0, // your browser type, version, the default value of the Operating System option is ContentType = application/x-www-form-urlencoded and ResultType = ResultType. string ,}; HttpResult result = http. getHtml (item); JObject ret = (JObject) JsonConvert. deserializeObject (result. html); if (! CheckResult (ret) {OnGetDataError (new RobotEventArgs (An error occurred while obtaining data during GetFriendQQ); return null;} JObject retjson = (JObject) ret [result]; string qq = retjson [account]. toString (); if (friendlist. containsKey (tuin) friendlist [tuin]. qq = qq; return qq ;}
So what functions do you need to add? You can directly debug the two. If anyone needs this project, they can give it to you, but they are paid.