C#????????????-?????????Demo??
???????????? ???????[ 2014/6/12 11:07:05 ] ????????C# ??? net
????????access_token??????????????????????????https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=appid&secret=secret??appid??secret???????????????????????????????????????????????json???????????access_token???
??????????????access_token????????Ч????Ч?????????????£????????????????????????????????????????????????????{"errcode":0??"errmsg":"ok"}???????????????????????????????Ч?????????????????????????Ч???????????1?????
???????????????
????????????????????????????get???????????????????????????
??????????????access_token????????Ч????Ч?????????????£????????????????????????????????????????????????????{"errcode":0??"errmsg":"ok"}???????????????????????????????Ч?????????????????????????Ч???????????1?????
???????????????
????????????????????????????get???????????????????????????
1 public partial class selectMenu : System.Web.UI.Page
2 {
3 protected void Page_Load(object sender?? EventArgs e)
4 {
5 GetPage("https://api.weixin.qq.com/cgi-bin/menu/get?access_token=access_token");
6 //GetPage("https://api.weixin.qq.com/cgi-bin/menu/delete?access_token=access_token");
7 }
8 public string GetPage(string posturl)
9 {
10 Stream instream = null;
11 StreamReader sr = null;
12 HttpWebResponse response = null;
13 HttpWebRequest request = null;
14 Encoding encoding = Encoding.UTF8;
15 // ???????...
16 try
17 {
18 // ???ò???
19 request = WebRequest.Create(posturl) as HttpWebRequest;
20 CookieContainer cookieContainer = new CookieContainer();
21 request.CookieContainer = cookieContainer;
22 request.AllowAutoRedirect = true;
23 request.Method = "GET";
24 request.ContentType = "application/x-www-form-urlencoded";
25 //?????????????????????
26 response = request.GetResponse() as HttpWebResponse;
27 //???request.GetResponse()???????????????????Post????
28 instream = response.GetResponseStream();
29 sr = new StreamReader(instream?? encoding);
30 //???????????html??????
31 string content = sr.ReadToEnd();
32 string err = string.Empty;
33 Response.Write(content);
34 return content;
35 }
36 catch (Exception ex)
37 {
38 string err = ex.Message;
39 return string.Empty;
40 }
41 }
42 }
|
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
???????C#?е?StringC# Socket???????????????????C#?????????????????????????C#???????C#????????????Log4net??????δ????C#?????????????C#?????????????????C#???????????????C#????????????????C#7 ?е?Tuple??????C#??TypeScript - GeneratorC# ?????????細(xì)??????????C#?е???н???C#??MySQL?????????μ??Ч?????д??C#????C++??dll???C#??VS2010????е??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????