다음을 통해 공유


MailTransportBindingElementBase.TimeToLive 속성

업데이트: 2007년 11월

이 바인딩을 위해 만들어진 출력 채널로 전송된 메시지의 수명을 결정하는 구조체를 가져오거나 설정합니다.

네임스페이스:  Microsoft.ServiceModel.Channels.Mail
어셈블리:  Microsoft.ServiceModel.Channels.Mail(Microsoft.ServiceModel.Channels.Mail.dll)

구문

‘선언
Public Property TimeToLive As TimeSpan
‘사용 방법
Dim instance As MailTransportBindingElementBase
Dim value As TimeSpan

value = instance.TimeToLive

instance.TimeToLive = value
public TimeSpan TimeToLive { get; set; }
public:
property TimeSpan TimeToLive {
    TimeSpan get ();
    void set (TimeSpan value);
}
public function get TimeToLive () : TimeSpan
public function set TimeToLive (value : TimeSpan)

속성 값

형식: System.TimeSpan
메시지의 수명입니다.

예외

예외 상황
ArgumentOutOfRangeException

TimeToLive가 TimeSpan.Zero보다 작은 경우

설명

이 속성은 메시지의 수명(출력 채널에서 메시지를 만든 후부터의 메시지 유효 기간)을 결정합니다. 대상 전송에서 수명이 경과된 메시지를 받으면 해당 메시지가 삭제되어 응용 프로그램에 전송되지 않습니다.

예제

다음 예제에서는 TimeToLive 속성을 사용하는 방법을 보여 줍니다. 여기에서는 메시지의 수명을 일, 시간, 분 및 초 단위로 지정할 수 있는 TimeSpan 생성자를 사용합니다.

mailTransportBindingElement = New WindowsMobileMailTransportBindingElement()

mailTransportBindingElement.MessageContainerType = MessageContainerType.Attachment
' In this example, set lifetime to 1 day, 10 hours,
' 20 minutes, and 30 seconds.
mailTransportBindingElement.TimeToLive = New TimeSpan(1, 10, 20, 30)
mailTransportBindingElement = new WindowsMobileMailTransportBindingElement();

mailTransportBindingElement.MessageContainerType = MessageContainerType.Attachment;
// In this example, set lifetime to 1 day, 10 hours,
// 20 minutes, and 30 seconds.
mailTransportBindingElement.TimeToLive = new TimeSpan(1, 10, 20, 30);

권한

  • 직접 실행 호출자의 경우 완전히 신뢰합니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분 신뢰 코드에서 라이브러리 사용을 참조하십시오.

플랫폼

Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC

.NET Framework 및 .NET Compact Framework에서 모든 플랫폼의 전체 버전을 지원하지는 않습니다. 지원되는 버전의 목록을 보려면 .NET Framework 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Compact Framework

3.5에서 지원

참고 항목

참조

MailTransportBindingElementBase 클래스

MailTransportBindingElementBase 멤버

Microsoft.ServiceModel.Channels.Mail 네임스페이스