To work fast two months, growth of course, there are some, but there are a lot of bad, a lot of things may not be in-depth understanding, can only do some simple functions, and then sometimes may be less efficient, the head more like disorderly thinking.
Keep a record of your work and study every day. Of course, the goal is to focus on the implementation of all the functions of the stage, performance, and so on later or the master to solve and raise the point and self-growth for some time.
New project, want me to do a personal center then in understanding and QQ third-party login now do some of the incomplete implementations only did three steps
Transfer to login page via link
Then log on to the success callback page to get code
String url = "Https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + AppID + "&redirect_uri=" + Redirect_uri + "&response_type=code&scope=snsapi_userinfo&state=state#wechat_redirect";
And then get Access_token by code.
String access_token = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=" + AppID + "&secret=" + Appsecret + " &code= "+ code +" &grant_type=authorization_code ";
Finally Access_token get personal information
String Getdate = "https://api.weixin.qq.com/sns/userinfo?access_token=" + Tokendate.access_token + "&openid=" + Tokendate.openid + "&LANG=ZH_CN";
HttpClient client = new HttpClient ();
String json = client. Getstringasync (Access_token). Result;
The data obtained is, of course, also to be deserialized next to the little master proposed to create an entity corresponding to the returned data format and then read directly as follows
String Getjson = client. Getstringasync (Getdate). Result;
Backdata da = jsonconvert.deserializeobject<backdata> (Getjson);
The Backdata entity is
public class Backdata
{
<summary>
User Nickname
</summary>
String Nickname {get; set;}
<summary>
Average user sex, 1 for men, 2 for women
</summary>
int sex {get; set;}
<summary>
Provinces
</summary>
String province {get; set;}
<summary>
User picture
</summary>
String Headimgurl {get; set;}
<summary>
City
</summary>
String City {get; set;}
<summary>
Countries
</summary>
String Country {get; set;}
<summary>
Unified identity
</summary>
int Unionid {get; set;}
}
It is also possible to deserialize through the following
Jobject Jo = (jobject) jsonconvert.deserializeobject (reader. ReadToEnd ());
string zo = jo["Data" ["forecast"]. ToString ();
A net intern's first blog post