Condividi tramite


TraceSection.WriteToDiagnosticsTrace Proprietà

Definizione

Ottiene o imposta un valore che indica se i messaggi generati tramite la traccia della pagina vengono inoltrati a un'istanza della Trace classe .

public:
 property bool WriteToDiagnosticsTrace { bool get(); void set(bool value); };
[System.Configuration.ConfigurationProperty("writeToDiagnosticsTrace", DefaultValue=false)]
public bool WriteToDiagnosticsTrace { get; set; }
[<System.Configuration.ConfigurationProperty("writeToDiagnosticsTrace", DefaultValue=false)>]
member this.WriteToDiagnosticsTrace : bool with get, set
Public Property WriteToDiagnosticsTrace As Boolean

Valore della proprietà

true se i messaggi di traccia vengono inviati alla Trace classe ; in caso contrario, false. Il valore predefinito è false.

Attributi

Esempio

Nell'esempio di codice seguente viene illustrato come utilizzare la WriteToDiagnosticsTrace proprietà . Questo esempio di codice fa parte di un esempio più ampio fornito per la TraceSection classe .


// Get the current WriteToDiagnosticsTrace property value.
Boolean writeToDiagnosticsTraceValue = traceSection.WriteToDiagnosticsTrace;

// Set the WriteToDiagnosticsTrace property to true.
traceSection.WriteToDiagnosticsTrace = true;

' Get the current WriteToDiagnosticsTrace property value.
Dim writeToDiagnosticsTraceValue As Boolean = traceSection.WriteToDiagnosticsTrace

' Set the WriteToDiagnosticsTrace property to true.
traceSection.WriteToDiagnosticsTrace = True

Si applica a