How can I use FTP to move files between directories?
问题 I have a program that needs to move a file from one directory to another on an FTP server. For example, the file is in: ftp://1.1.1.1/MAIN/Dir1 and I need to move the file to: ftp://1.1.1.1/MAIN/Dir2 I found a couple of articles recommending use of the Rename command, so I tried the following: Uri serverFile = new Uri(“ftp://1.1.1.1/MAIN/Dir1/MyFile.txt"); FtpWebRequest reqFTP= (FtpWebRequest)FtpWebRequest.Create(serverFile); reqFTP.Method = WebRequestMethods.Ftp.Rename; reqFTP.UseBinary =