FtpWebResponse.LastModified プロパティ
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
FTP サーバー上のファイルが最後に更新された日時を取得します。
public:
property DateTime LastModified { DateTime get(); };
public DateTime LastModified { get; }
member this.LastModified : DateTime
Public ReadOnly Property LastModified As DateTime
プロパティ値
ファイルの最終更新日時を格納している DateTime。
例
次のコード例では、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;
}
注釈
プロパティは LastModified 、 メソッドによって要求されたデータを GetDateTimestamp 返します。 他のメソッドを使用して送信された要求の場合、 LastModified は を返します MinValue。