string url = HttpContext.Current.Request.Url.AbsoluteUri;
HttpWebRequest myReq = (HttpWebRequest)HttpWebRequest.Create(url);
myReq.Timeout = timeout;
//myReq.Method="POST";
myReq.ContentType = "application/x-www-form-urlencoded";
//Stream myStream = myReq.GetRequestStream();
WebResponse HttpWResp = myReq.GetResponse();
myReq.Abort();
HttpWResp.Close();
//Stream myStream = HttpWResp.GetResponseStream();
using (Stream myStream = HttpWResp.GetResponseStream())
{
//stream.Write(buffer, 0, buffer.Length);
StreamReader sr = new StreamReader(myStream, EnCodeType);
StringBuilder strBuilder = new StringBuilder();
while (-1 != sr.Peek())
{
strBuilder.Append(sr.ReadLine());
if (enterType == 1)
{
strBuilder.Append("\r\n");
}
}
strResult = strBuilder.ToString();
sr.Close();
}
这个是我的代码 怎么读不到 当前页面的内容啊~ 放到测试服务器上是好的
但是换了一个服务器一直 提示操作超时 好纠结 急死了
- 4 回答
- 0 关注
- 1338 浏览
添加回答
举报
0/150
提交
取消