HttpCachePolicy.SetLastModified(DateTime) 메서드

정의

HTTP 헤더를 Last-Modified 제공된 값으로 DateTime 설정합니다.

public:
 void SetLastModified(DateTime date);
public void SetLastModified(DateTime date);
member this.SetLastModified : DateTime -> unit
Public Sub SetLastModified (date As DateTime)

매개 변수

date
DateTime

헤더의 새 DateTime 값입니다 Last-Modified .

예외

date 가 현재 DateTime보다 늦습니다.

예제

다음 코드 예제에서는 헤더를 새 날짜로 설정하는 Last-Modified 방법을 보여 줍니다.

Response.Cache.SetLastModified(DateTime.Parse("1/1/2001 00:00:01AM"));
Response.Cache.SetLastModified(DateTime.Parse("1/1/2001 00:00:01AM"))

설명

Last-Modified HTTP 헤더 타임스탬프는 문서가 마지막으로 수정된 시기를 나타내는 값으로 DateTime 문서에 스탬프를 찍습니다.

캐싱 제한 계층 구조를 위반하면 이 메서드가 실패합니다.

SetLastModified .NET Framework 버전 3.5에 도입되었습니다. 자세한 내용은 버전 및 종속성을 참조하세요.

적용 대상