1.后台调用weburlstring hostUrl = "http://www.a.com?id=123" ;HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create(hostUrl);myReq.Me ...
1.后台调用weburl
get='_blank'>string hostUrl = "http://www.a.com?id=123" ;HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create(hostUrl);myReq.Method = "GET";HttpWebResponse HttpWResp = (HttpWebResponse)myReq.GetResponse();Stream myStream = HttpWResp.GetResponseStream();StreamReader sr = new StreamReader(myStream, Encoding.UTF8);StringBuilder strBuilder = new StringBuilder();while (-1 != sr.Peek()){strBuilder.Append(sr.ReadLine());}sr.Close();myStream.Close();HttpWResp.Close();Newtonsoft.Json.Linq.JObject jo = (Newtonsoft.Json.Linq.JObject)Newtonsoft.Json.JsonConvert.DeserializeObject(strBuilder.ToString());string resCode = jo["ReturnCode"].ToString();
原标题:C# 常用公共方法
关键词:C#
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们:
admin#shaoqun.com
(#换成@)。