0

这是正在发生的事情。我正在使用 WebClient 打开一个存在于 FTP 上的文件。该文件存在并且该函数过去曾工作过,但现在由于某种原因引发了异常。(System.Net.WebException:远程服务器返回错误:(550)文件不可用(例如,找不到文件,无法访问)。)。有趣的是,脚本仍然会打开文件并执行它应该做的事情。有没有人听说过这样的事情?

WebClient downloadRequest = new WebClient();
downloadRequest.Credentials = new NetworkCredential(pusername, ppassword);
byte[] downloadBytes = downloadRequest.DownloadData(purl);

这是堆栈跟踪:

[WebException: The remote server returned an error: (550) File unavailable (e.g., file not found, no access).]
System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request) +287
System.Net.WebClient.DownloadData(Uri address) +106
System.Net.WebClient.DownloadData(String address) +29
ftp_connect.copyFile(String purl, String pusername, String ppassword, String pubordev) in d:\wwwdev\test\ftp\ftpconnect.aspx.cs:112
ftp_connect.copyFolder(String purl, String pusername, String ppassword, String pubordev) in d:\wwwdev\test\ftp\ftpconnect.aspx.cs:160
ftp_connect.Page_Load(Object sender, EventArgs e) in d:\wwwdev\test\ftp\ftpconnect.aspx.cs:93
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
4

4 回答 4

0

大概是以前成功运行的文件吗?

于 2009-07-30T16:12:33.260 回答
0

该脚本可能正在使用 Web 请求仍在工作时保存的文件版本。

于 2009-07-30T16:12:57.520 回答
0

也许该文件由其他一些客户/用户在用户中。

于 2009-07-30T16:14:18.983 回答
0

事实证明,我正在调用一个函数,该函数调用了我试图访问的函数。

所以,我猜的解决方案是查看堆栈。应该先这样做。

于 2009-07-30T18:27:11.570 回答