TraceSource.Name Propriedade
Definição
Obtém o nome da origem de rastreamento.Gets the name of the trace source.
public:
property System::String ^ Name { System::String ^ get(); };
public string Name { get; }
member this.Name : string
Public ReadOnly Property Name As String
Valor da propriedade
O nome da origem de rastreamento.The name of the trace source.
Exemplos
O exemplo de código a seguir mostra como nomear uma origem de rastreamento na chamada de construtor.The following code sample shows how to name a trace source in the constructor call. Este exemplo de código faz parte de um exemplo maior fornecido para a TraceSource classe.This code example is part of a larger example provided for the TraceSource class.
// Initialize the trace source.
static TraceSource ts = new TraceSource("TraceTest");
' Initialize the trace source.
Private Shared ts As New TraceSource("TraceTest")
Comentários
O nome é definido pelo name parâmetro passado para o construtor.The name is set by the name parameter passed to the constructor. Você pode consultar a origem do rastreamento usando o name atributo no arquivo de configuração.You can refer to the trace source by using the name attribute in the configuration file.
O elemento XML a seguir mostra como fazer referência a uma origem de rastreamento no arquivo de configuração.The following XML element shows referring to a trace source in the configuration file.
<configuration>
<system.diagnostics>
<sources>
<source name="TraceTest">
</source>
</sources>
</system.diagnostics>
</configuration>