protected void Page_Load(object sender, EventArgs e) { string json = GetMenusJson(); string AccessToken = WeChatCommon.GetAccessToken().Data.access_token; string url = "https://api.weixin.qq.com/cgi-bin/menu/create?access_token=" + AccessToken; string s = RestServiceProxy.Post(json, url); errcode_msg M = new errcode_msg(); M = JsonConvert.DeserializeObject <errcode_msg>(s); //string ss = GetPage(url, json); }
public static BaseResponse <TokenModel> GetAccessToken() { BaseResponse <TokenModel> response = new BaseResponse <TokenModel>(); TokenModel M = new TokenModel(); string Uri = string.Format(WeChatUri.GetAccessTokenUri, appid, appsecret); M = RestServiceProxy.GetOne <TokenModel>(Uri); if (!string.IsNullOrEmpty(M.access_token)) { response = SetResponse <TokenModel>(M); } return(response); }