跨网站提交数据
两个网站都在同一个服务器里面,网站A有个 a.aspx页面 我想把里面的两个变量数据 传给网站B的 b.aspx
页面后台接收到这两个数据 该如何实现呢
[解决办法]
StringBuilder sb = new StringBuilder();
sb.Append("1");
sb.Append("2");
string vpcURL = "https://b.aspx";
System.Net.WebClient webClient = new System.Net.WebClient();
webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
byte[] response = webClient.UploadData(vpcURL, "POST", System.Text.Encoding.ASCII.GetBytes(sb.ToString()));
string responseData = System.Text.Encoding.ASCII.GetString(response, 0, response.Length);
string result = GetContent(responseData, "vpc_TxnResponseCode=", "&", 2);