C# 后台模拟请求一般处理程序

            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;
原文地址:https://www.cnblogs.com/Apex233/p/7811337.html