WebClient webClient = new WebClient(); NameValueCollection formData = new NameValueCollection(); //输出值 formData["type"] = "webService_InsertSBKSCRKBD"; formData["SBKSCRKB"] = SBKSCRKB; //页面地址 地址加域名 string posturl = "http://" + HttpContext.Current.Request.Url.Authority+ "/PTHC/data/PTHCSY_data.ashx"; //读取地址并进入一般处理程序 byte[] responseBytes = webClient.UploadValues(posturl, "POST", formData); //接收返回值 string responsefromserver = Encoding.UTF8.GetString(responseBytes); webClient.Dispose(); return responsefromserver;
posted on 2017-11-09 20:37 Apex_233 阅读( ...) 评论( ...) 编辑 收藏
转载于:https://www.cnblogs.com/Apex233/p/7811337.html
相关资源:C# asp.net http HttpWebRequest模拟浏览器请求下载文件到本地.txt