C # WebQQ protocol group robot (3 ),
In the first two articles, I have provided most WEBQQ operations.
Article 2 http://blog.csdn.net/zhujunxxxxx/article/details/38941599
Article 1 http://blog.csdn.net/zhujunxxxxx/article/details/38931287
This article does not describe too many practices.
This article source http://blog.csdn.net/zhujunxxxxx reprint please note
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 (Wi Ndows 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", ResultType = ResultType. string ,}; HttpResult result = http. getHtml (item); JObject ret = (JObject) JsonConvert. deserializeObject (result. html); if (! CheckResult (ret) {OnGetDataError (new RobotEventArgs ("Get data error when 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.
It's really sad to see a lot of reposted articles without any source.
In C language-> what?
-> Is a whole. It is used to point to a struct, class in C ++, and other pointers containing sub-data to obtain sub-data. In other words, if we define a struct in C and declare a pointer pointing to this struct, we need to use "->" to retrieve the data in the struct using the pointer ".
For example:
Struct Data
{
Int a, B, c;
};/* Define struct */
Struct Data * p;/* define struct pointer */
Struct Data A = {1, 2, 3};/* declare variable */
Int x;/* declare a variable x */
P = & A;/* point p to */
X = p-> a;/* indicates that the data item a in the struct pointed to by p is assigned to x */
/* Because p points to A, p-> a = A. a, that is, 1 */
For the first problem, p = p-> next; this should appear in the linked list of C language. next here should be a struct pointer of the same type as p, and its definition format should be:
Struct Data
{
Int;
Struct Data * next;
};/* Define struct */
............
Main ()
{
Struct Data * p;/* declare the pointer Variable p */
......
P = p-> next;/* assign the value in next to p */
}
The linked list pointer is a difficulty in C language, but it is also the key. It is very useful to learn it. To be careful, you must first talk about variables and pointers.
What is a variable? The so-called variables should not be simply thought that the amount will become a variable. Let's use the question of our Dean: "Is the classroom changing ?" Change, because there are different people in the classroom every day, but they do not change, because the classroom is always there, and it does not become larger or smaller. This is the variable: There is a constant address and a variable storage space. Under normal circumstances, we only see the variable in the room, that is, its content, but do not pay attention to the variable address, but the C language pointer is the address of the room. We declare that variables are equivalent to building a house to store things. We can directly watch things in the house, while declaring pointers is equivalent to getting a positioner. When a pointer points to a variable, it is to use the pointer to locate the variable. Then we can use the pointer to find the variable "tracked" and get the content in it.
What about struct? The structure is equivalent to a villa composed of several houses, and several houses are bound for use together. Suppose there are many such villas distributed in a big maze, and each villa has a house. The location information of another villa is put in it. Now you have found the first villa with the positioner and obtained what you want from it (the data part of the linked list ), then, calculate the location of the next villa into your positioner (p = p-> next), and go down to the next villa ...... If you go on like this, you will know that the information of a villa on the ground is gone (p-> next = NULL), and your trip is over. This is the process of traversing a linked list. Now you can understand the meaning of p = p-> next!
Write so much. I hope you can understand.
If you want to learn c and C ++ well, you must be familiar with linked lists and pointers!
In C language-> what?
-> Is a whole. It is used to point to a struct, class in C ++, and other pointers containing sub-data to obtain sub-data. In other words, if we define a struct in C and declare a pointer pointing to this struct, we need to use "->" to retrieve the data in the struct using the pointer ".
For example:
Struct Data
{
Int a, B, c;
};/* Define struct */
Struct Data * p;/* define struct pointer */
Struct Data A = {1, 2, 3};/* declare variable */
Int x;/* declare a variable x */
P = & A;/* point p to */
X = p-> a;/* indicates that the data item a in the struct pointed to by p is assigned to x */
/* Because p points to A, p-> a = A. a, that is, 1 */
For the first problem, p = p-> next; this should appear in the linked list of C language. next here should be a struct pointer of the same type as p, and its definition format should be:
Struct Data
{
Int;
Struct Data * next;
};/* Define struct */
............
Main ()
{
Struct Data * p;/* declare the pointer Variable p */
......
P = p-> next;/* assign the value in next to p */
}
The linked list pointer is a difficulty in C language, but it is also the key. It is very useful to learn it. To be careful, you must first talk about variables and pointers.
What is a variable? The so-called variables should not be simply thought that the amount will become a variable. Let's use the question of our Dean: "Is the classroom changing ?" Change, because there are different people in the classroom every day, but they do not change, because the classroom is always there, and it does not become larger or smaller. This is the variable: There is a constant address and a variable storage space. Under normal circumstances, we only see the variable in the room, that is, its content, but do not pay attention to the variable address, but the C language pointer is the address of the room. We declare that variables are equivalent to building a house to store things. We can directly watch things in the house, while declaring pointers is equivalent to getting a positioner. When a pointer points to a variable, it is to use the pointer to locate the variable. Then we can use the pointer to find the variable "tracked" and get the content in it.
What about struct? The structure is equivalent to a villa composed of several houses, and several houses are bound for use together. Suppose there are many such villas distributed in a big maze, and each villa has a house. The location information of another villa is put in it. Now you have found the first villa with the positioner and obtained what you want from it (the data part of the linked list ), then, calculate the location of the next villa into your positioner (p = p-> next), and go down to the next villa ...... If you go on like this, you will know that the information of a villa on the ground is gone (p-> next = NULL), and your trip is over. This is the process of traversing a linked list. Now you can understand the meaning of p = p-> next!
Write so much. I hope you can understand.
If you want to learn c and C ++ well, you must be familiar with linked lists and pointers!