【发布时间】:2013-09-06 20:41:21
【问题描述】:
我的 WPF 应用程序有问题,它正在返回 “远程服务器返回错误:(500)内部服务器错误”在我的回调函数中。
我有以下代码;
System.Diagnostics.Debug.WriteLine("GetProduct DownloadStringAsync ");
try
{
GetProduct.DownloadStringAsync(uri);
}
catch (Exception ee)
{
System.Diagnostics.Debug.WriteLine("CATCH GetProduct DownloadStringAsync " + ee.Message);
}
在我的回调方法中:
private void GetProductCallBack(Object sender, DownloadStringCompletedEventArgs e)
{
if (e.Error != null)
{
. . .
e.Error = "远程服务器返回错误:(500) Internal Server Error"
是服务器访问问题还是我的代码有问题? 关于URI,已经测试过了,没问题。
谢谢
【问题讨论】:
-
你的回调方法很奇怪。为什么要覆盖错误描述?
-
它不完整,只是为了告诉你我在一开始就得到了错误..