日期:2014-05-18 浏览次数:20937 次
System.Net.ServicePointManager.Expect100Continue = false; WebClient webClient = new WebClient(); webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded"); webClient.Headers.Add("Content-Type", "charset=UTF-8"); webClient.Headers.Add(HttpRequestHeader.KeepAlive, "false"); webClient.Headers.Add("Cache-Control", "no-cache"); webClient.Headers.Add("User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"); byte[] postData = Encoding.UTF8.GetBytes(postString); byte[] responseData = webClient.UploadData("http://xxx.com/a.aspx", "POST", postData); string srcString = Encoding.Default.GetString(responseData);