Compartir a través de


FtpWebResponse.LastModified Propiedad

Definición

Obtiene la fecha y hora en que se modificó por última vez un archivo en un servidor FTP.

public:
 property DateTime LastModified { DateTime get(); };
public DateTime LastModified { get; }
member this.LastModified : DateTime
Public ReadOnly Property LastModified As DateTime

Valor de propiedad

DateTime que contiene la fecha y hora de última modificación de un archivo.

Ejemplos

En el ejemplo de código siguiente se muestra la fecha y hora en que se modificó por última vez un archivo en un servidor FTP.

public static bool GetDateTimestampOnServer (Uri serverUri)
{
    // The serverUri should start with the ftp:// scheme.
    if (serverUri.Scheme != Uri.UriSchemeFtp)
    {
        return false;
    }

    // Get the object used to communicate with the server.
    FtpWebRequest request = (FtpWebRequest)WebRequest.Create (serverUri);
    request.Method = WebRequestMethods.Ftp.GetDateTimestamp;
    FtpWebResponse response = (FtpWebResponse)request.GetResponse ();
    Console.WriteLine ("{0} {1}",serverUri,response.LastModified);

    // The output from this method will vary depending on the
    // file specified and your regional settings. It is similar to:
    // ftp://contoso.com/Data.txt 4/15/2003 10:46:02 AM
    return true;
}

Comentarios

La LastModified propiedad devuelve los datos solicitados por el GetDateTimestamp método . Para las solicitudes enviadas mediante cualquier otro método, LastModified devuelve MinValue.

Se aplica a

Consulte también