SocketTools .NET Edition

FtpClient.SetFileTime Method 

Changes the modification date and time for a file on the server.

[Visual Basic]
Public Function SetFileTime( _
   ByVal remoteFile As String, _
   ByVal fileDate As Date _
) As Boolean
[C#]
public bool SetFileTime(
   string remoteFile,
   DateTime fileDate
);

Parameters

remoteFile
A string that specifies the name of the file on the server. The filename cannot contain any wildcard characters and must follow the naming conventions of the operating system the server is hosted on.
fileDate
A System.DateTime value that specifies the new date and time for the file.

Return Value

This method returns a boolean value. If the method succeeds, the return value is true. If the method fails, the return value is false. To get extended error information, check the value of the LastError property.

Remarks

The SetFileTime method changes the modification date and time for the specified file on the remote server. This method uses the MTDM command to change the modification time for the file. If the server does not support this command, the method will return an error. Note that some servers only support the MDTM command to return, but not change, the file modification time.

See Also

FtpClient Class | SocketTools Namespace