我想從ftp服務器下載圖像,但當我去「FtpWebResponse」時, 。遠程服務器返回錯誤:(550)文件不可用(例如,文件未找到,無法訪問)
下面是我的下載功能
FtpWebRequest request = (FtpWebRequest)WebRequest.Create(myStringWebSource);
request.Method = WebRequestMethods.Ftp.DownloadFile;
request.Credentials = new NetworkCredential(this.FtpUserID, this.FtpPassword);
FtpWebResponse response = (FtpWebResponse)request.GetResponse();
System.IO.Stream responseStream = response.GetResponseStream();
System.IO.StreamReader reader = new System.IO.StreamReader(responseStream);
System.IO.StreamWriter writer = new System.IO.StreamWriter(SaveFile);
writer.Write(reader.ReadToEnd());
writer.Close();
reader.Close();
response.Close();
我有谷歌這個例外幾天,但我仍然無法弄清楚,爲什麼這讓錯誤的。如果沒有足夠的信息,請告訴我。