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.