private string RunHttp(string action, params string[] paraStrArr) { string content = "action=" + action + "&dataArrStr="; if (paraStrArr != null) { foreach (string str in paraStrArr) { content += System.Web.HttpUtility.UrlEncode(str) + ","; } content = content.Substring(0, content.Length - 1); } try { return(webHttp.DoPost(evalActionUrl, encryption.EncryptData(content))); } catch (Exception ex) { onError("DoPost exception:" + content + " ,", ex); return(null); } }
//post提交 public string PostDataGetHtml(string postData) { byte[] data = encoding.GetBytes(postData); //Uri uRI = new Uri("http://entrust.reapal.com/agentpay/pay?"); MyHttpUtility http = new MyHttpUtility(); return(http.DoPost("http://entrust.reapal.com/agentpay/pay?", data)); //HttpWebRequest req = WebRequest.Create(uRI) as HttpWebRequest; //req.Method = "POST"; //req.KeepAlive = true; //req.ContentType = "application/x-www-form-urlencoded"; //req.ContentLength = data.Length; //req.AllowAutoRedirect = true; //Stream outStream = req.GetRequestStream(); //outStream.Write(data, 0, data.Length); //outStream.Close(); //HttpWebResponse res = req.GetResponse() as HttpWebResponse; //Stream inStream = res.GetResponseStream(); //StreamReader sr = new StreamReader(inStream, System.Text.Encoding.Default); //string htmlResult = sr.ReadToEnd(); //return htmlResult; }
//post提交 public string PostDataGetHtml(string postData) { byte[] data = encoding.GetBytes(postData); //Uri uRI = new Uri("http://entrust.reapal.com/agentpay/pay?"); MyHttpUtility http = new MyHttpUtility(); return http.DoPost("http://entrust.reapal.com/agentpay/pay?", data); //HttpWebRequest req = WebRequest.Create(uRI) as HttpWebRequest; //req.Method = "POST"; //req.KeepAlive = true; //req.ContentType = "application/x-www-form-urlencoded"; //req.ContentLength = data.Length; //req.AllowAutoRedirect = true; //Stream outStream = req.GetRequestStream(); //outStream.Write(data, 0, data.Length); //outStream.Close(); //HttpWebResponse res = req.GetResponse() as HttpWebResponse; //Stream inStream = res.GetResponseStream(); //StreamReader sr = new StreamReader(inStream, System.Text.Encoding.Default); //string htmlResult = sr.ReadToEnd(); //return htmlResult; }