Bagikan melalui


IHttpSessionState.Timeout Properti

Definisi

Mendapatkan atau mengatur periode waktu habis (dalam menit) yang diizinkan antara permintaan sebelum penyedia keadaan sesi mengakhiri sesi.

public:
 property int Timeout { int get(); void set(int value); };
public int Timeout { get; set; }
member this.Timeout : int with get, set
Public Property Timeout As Integer

Nilai Properti

Periode waktu habis, dalam hitung menit.

Contoh

Contoh kode berikut mengimplementasikan Timeout properti IHttpSessionState antarmuka untuk mendapatkan dan mengatur nilai batas waktu sesi yang disimpan dalam variabel internal yang dibuat di konstruktor kelas.

public int Timeout
{
  get { return pTimeout; }
  set
  {
    if (value <= 0)
      throw new ArgumentException("Timeout value must be greater than zero.");

    if (value > MAX_TIMEOUT)
      throw new ArgumentException("Timout cannot be greater than " + MAX_TIMEOUT.ToString());

    pTimeout = value;
  }
}
Public Property Timeout As Integer Implements IHttpSessionState.Timeout
  Get
    Return pTimeout
  End Get
  Set
    If value <= 0 Then _
      Throw New ArgumentException("Timeout value must be greater than zero.")

    If value > MAX_TIMEOUT Then _
      Throw New ArgumentException("Timout cannot be greater than " & MAX_TIMEOUT.ToString())

    pTimeout = value
  End Set
End Property

Berlaku untuk

Lihat juga