FtpClient.GetModifiedTime Method

System.Net.FtpClient

Collapse image Expand Image Copy image CopyHover image
Gets the modified time of the file

Namespace: System.Net.FtpClient
Assembly: System.Net.FtpClient (in System.Net.FtpClient.dll) Version: 1.0.5064.17461

Syntax

C#
public virtual DateTime GetModifiedTime(
	string path
)
Visual Basic
Public Overridable Function GetModifiedTime ( 
	path As String
) As DateTime
Visual C++
public:
virtual DateTime GetModifiedTime(
	String^ path
)

Parameters

path
Type: System..::..String
The full path to the file

Return Value

Type: DateTime
The modified time, DateTime.MinValue if there was a problem

Implements

IFtpClient..::..GetModifiedTime(String)

Examples

C#  Copy imageCopy
using System;
using System.Net;
using System.Net.FtpClient;

namespace Examples {
    static class GetModifiedTimeExample {
        public static void GetModifiedTime() {
            using (FtpClient conn = new FtpClient()) {
                conn.Host = "localhost";
                conn.Credentials = new NetworkCredential("ftptest", "ftptest");
                Console.WriteLine("The modified type is: {0}",
                    conn.GetModifiedTime("/full/or/relative/path/to/file"));
            }
        }
    }
}

See Also