【发布时间】:2012-04-25 16:32:35
【问题描述】:
我收到此错误:
(远程服务器返回错误:(500) Internal Server Error. at System.Net.HttpWebRequest.GetResponse())
突然出现在我使用 c# 制作的一个 Windows 应用程序中。我已经使用这个应用程序多年了,直到昨天才出现任何问题。它突然开始抛出这个错误。
下面是我调用的方法和网址:
public string CallOnlineUrl() {
try {
Uri onlineupdateUrl = new Uri("https://billett.tusenfryd.no/admin/update.aspx");
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(onlineupdateUrl);
System.Net.WebResponse resp = req.GetResponse();
System.IO.Stream stream = resp.GetResponseStream();
//****some code
//-------
} catch(Exception ex) {
ERPLog.AddLogEntry(ex.Message + ex.StackTrace);
}
return cont;
}
感谢任何帮助或解决此问题的建议:)
【问题讨论】:
-
谁拥有服务器代码?如果有的话,您能否发布您从服务器获取的错误详细信息?
-
你调试了吗? InnerException 可能包含有关失败的更多详细信息。
-
@Yuck:如果我在浏览器中打开相同的链接,它会正常打开而不会出现任何故障......所以我不能要求管理网站的一方在那里检查。@Dave:我会的现在尝试调试内部异常..谢谢
标签: c# httpwebrequest httpwebresponse