ServicePoint.IdleSince Proprietà

Definizione

Ottiene la data e l'ora dell'ultima connessione a un host da parte dell'oggetto ServicePoint.

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

Valore della proprietà

Oggetto DateTime contenente la data e l'ora dell'ultima connessione all'oggetto ServicePoint.

Esempio

Nell'esempio di codice seguente viene utilizzata la IdleSince proprietà per impostare e recuperare la data e l'ora dell'ultima connessione dell'oggetto ServicePoint a un host.

// 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()))

Commenti

La IdleSince proprietà registra l'ultima data e l'ora in cui un punto di servizio è stato disconnesso da un host. Quando la differenza tra l'ora corrente e IdleSince supera il valore di MaxIdleTime, l'oggetto ServicePoint è disponibile per il riciclo a un'altra connessione.

Si applica a