This method renames the file on the FTP server with specified host name, path name and port number.
[Visual Basic] Public Function RenameFile(ByVal
remoteHost As String, ByVal oldRemotePath As String, ByVal
remotePort As Integer, ByVal newRemotePath As String) As
Boolean
[C#] public bool RenameFile(string remoteHost,
string oldRemotePath, int remotePort, string newRemotePath);
Parameters
- remoteHost
- Domain name in DNS style, or IP address
- oldRemotePath
- The old remote filename and path
- remotePort
- IP port number
- newRemotePath
- The new remote filename and path
Return Value
Returns True if successful. Returns False if unsuccessful.
Explanation
The RenameFile method renames the file on the FTP server with specified host name, path name and port number.
This method is effective for the FTP protocol.
Example
[Visual Basic.NET] Dim _ftp As New Newtone.ImageKit.Ftp Dim Ret As Boolean 'Username and password _ftp.Credentials = New NetworkCredential("user", "password") 'Renames the file Ret = _ftp.RenameFile("www.newtone.co.jp", "test/test.jpg", 21, "test/test1.jpg") [Visual C#.NET] Newtone.ImageKit.Ftp _ftp = new Newtone.ImageKit.Ftp(); bool Ret; //Username and password _ftp.Credentials = new NetworkCredential("user", "password"); //Renames the file Ret = _ftp.RenameFile("www.newtone.co.jp", "test/test.jpg", 21, "test/test1.jpg");