FtpWebRequest ftpWeb;
FtpWebResponse r;
string uri;
uri="ftp://xxx.xxx.xxx.xxx/filedirectory/" + file_name;
ftpWeb = (FtpWebRequest)FtpWebRequest.Create(new Uri(uri));
ftpWeb.Credentials = new NetworkCredential("userid", "pwd");
ftpWeb.RenameTo = file_name.Replace("file_name", "rename_file");
ftpWeb.Method = WebRequestMethods.Ftp.Rename;
r = (FtpWebResponse)ftpWeb.GetResponse();
uri = "ftp://xxx.xxx.xxx.xxx/filedirectory/" + file_name2;
ftpWeb = (FtpWebRequest)FtpWebRequest.Create(new Uri(uri));
ftpWeb.Credentials = new NetworkCredential("userid", "pwd");
ftpWeb.RenameTo = file_name2.Replace("file_name2", "rename_file2");
ftpWeb.Method = WebRequestMethods.Ftp.Rename;
r = (FtpWebResponse)ftpWeb.GetResponse(); // here is error
第一个文件成功重命名,但是第二个文件失败... 如何解决这个问题呢?帮帮我。
这是我的代码。错误代码是500。