我有一个困扰我很久的问题。
我正在使用 Windows Phone 8 和 c#。
从网上下载文件时,我有时会收到此异常:
A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.ni.dll
A first chance exception of type 'System.Net.WebException' occurred in System.Windows.ni.dll
A first chance exception of type 'System.Net.WebException' occurred in System.Windows.ni.dll
ExceptionMessage:The remote server returned an error: NotFound.
但后来我再次运行程序,它工作正常。不知道为什么有时候找不到远程服务器,真的是服务器的问题吗?它认为它在我的代码中,我使用这些函数:
WebRequest request = WebRequest.Create("http...);
IAsyncResult res = request.BeginGetResponse(new AsyncCallback(DownloadComplete), null);
我会很感激任何建议,因为这个异常不断弹出,我无法解决它。