ServicePoint.IdleSince Właściwość

Definicja

Pobiera datę i godzinę ostatniego ServicePoint połączenia obiektu z hostem.

public:
 property DateTime IdleSince { DateTime get(); };
public DateTime IdleSince { get; }
member this.IdleSince : DateTime
Public ReadOnly Property IdleSince As DateTime

Wartość właściwości

DateTime Obiekt zawierający datę i godzinę ostatniego ServicePoint połączenia obiektu.

Przykłady

W poniższym przykładzie kodu użyto IdleSince właściwości , aby ustawić i pobrać datę i godzinę ServicePoint ostatniego połączenia obiektu z hostem.

// Display the date and time that the ServicePoint was last 
// connected to a host.
Console::WriteLine( "IdleSince = {0}", sp->IdleSince );

// Display the maximum length of time that the ServicePoint instance  
// is allowed to maintain an idle connection to an Internet  
// resource before it is recycled for use in another connection.
Console::WriteLine( "MaxIdleTime = {0}", sp->MaxIdleTime );
// Display the date and time that the ServicePoint was last
// connected to a host.
Console.WriteLine("IdleSince = " + sp.IdleSince.ToString());

// Display the maximum length of time that the ServicePoint instance
// is allowed to maintain an idle connection to an Internet
// resource before it is recycled for use in another connection.
Console.WriteLine("MaxIdleTime = " + sp.MaxIdleTime);
' Display the date and time that the ServicePoint was last 
' connected to a host.
Console.WriteLine(("IdleSince = " + sp.IdleSince.ToString()))


' Display the maximum length of time that the ServicePoint instance 
' is allowed to maintain an idle connection to an Internet  
' resource before it is recycled for use in another connection.
Console.WriteLine(("MaxIdleTime = " + sp.MaxIdleTime.ToString()))

Uwagi

Właściwość IdleSince rejestruje ostatnią datę i godzinę odłączenia punktu usługi od hosta. Gdy różnica między bieżącym czasem i IdleSince przekracza wartość MaxIdleTime, ServicePoint obiekt jest dostępny do recyklingu do innego połączenia.

Dotyczy