当前位置:编程学习 > C#/ASP.NET >>

搜狐微薄开发 遇到 远程服务器返回错误: (500) 内部服务器错误.求高手解决..帮帮忙阿

这个错误在发布微博的时候,有的时候会出现,有的时候不会出现(疑问处)这是为什么呢???
出错都是在这行代码出错   
responseReader = new StreamReader(webRequest.GetResponse().GetResponseStream()); 
 
异常详细信息: System.Net.WebException: 远程服务器返回错误: (500) 内部服务器错误。 源错误: 行 120: finally行 121: {行 122:            webRequest.GetResponse().GetResponseStream().Close();行 123: responseReader.Close();行 124: }    源文件: d:\weibo\SohuXAuth\SohuXAuth\App_Code\BaseHttpRequest.cs    行: 122  


 楼主 发表于: 2013-01-08 16:51:59 
这个错误有的时候会出现有的时候不会出现(疑问处)这是为什么呢???出错都是在这行代码出错   responseReader = new StreamReader(webRequest.GetResponse().GetResponseStream());  

异常详细信息: System.Net.WebException: 远程服务器返回错误: (500) 内部服务器错误。 源错误: 行 120: finally行 121: {行 122:            webRequest.GetResponse().GetResponseStream().Close();行 123: responseReader.Close();行 124: }    源文件: d:\weibo\SohuXAuth\SohuXAuth\App_Code\BaseHttpRequest.cs    行: 122   
   

堆栈跟踪: [WebException: 远程服务器返回错误: (500) 内部服务器错误。]System.Net.HttpWebRequest.GetResponse() +5386189 BaseHttpRequest.GetHttpWebResponse(WebRequest webRequest) in d:\weibo\SohuXAuth\SohuXAuth\App_Code\BaseHttpRequest.cs:122 HttpPost.GetHttpWebResponse(WebRequest httpWebRequest, String postData) in d:\weibo\SohuXAuth\SohuXAuth\App_Code\HttpPost.cs:43 HttpPost.WebRequest(String method, String url, String postData) in d:\weibo\SohuXAuth\SohuXAuth\App_Code\HttpPost.cs:28 HttpPost.Request(String uri, String postData) in d:\weibo\SohuXAuth\SohuXAuth\App_Code\HttpPost.cs:18 SohuService.Update(String token, String secret, String status) in d:\weibo\SohuXAuth\SohuXAuth\App_Code\SohuService.cs:68 _Default.Page_Load(Object sender, EventArgs e) in d:\weibo\SohuXAuth\SohuXAuth\Default.aspx.cs:36 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35 System.Web.UI.Control.OnLoad(EventArgs e) +99 System.Web.UI.Control.LoadRecursive() +50 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627 

 知道的大侠帮我解决一下!!!谢谢
!!!!

--------------------编程问答-------------------- 频繁访问一个地址有时候会禁止再次访问的 --------------------编程问答-------------------- 应该不是这个原因吧,我开发的新浪微博,不停的发微博也不会出现这个错误的! --------------------编程问答-------------------- 新浪微博?? 膜拜 --------------------编程问答-------------------- 是搜狐微博、、、 --------------------编程问答-------------------- using(responseReader = new StreamReader(webRequest.GetResponse().GetResponseStream()))
{
  ,,,
}
可以用using试试 --------------------编程问答-------------------- 用了using 的还是会报远程服务500错误
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,