EventSource.WriteEvent Método
Definição
Grava um evento usando o identificador de evento e argumentos opcionais fornecidos.Writes an event by using the provided event identifier and optional arguments.
Sobrecargas
| WriteEvent(Int32, String, String, String) |
Grava um evento usando o identificador de evento e os argumentos de cadeia de caractere fornecidos.Writes an event by using the provided event identifier and string arguments. |
| WriteEvent(Int32, String, Int32, Int32) |
Grava um evento usando o identificador de evento fornecido e os argumentos.Writes an event by using the provided event identifier and arguments. |
| WriteEvent(Int32, Int64, Int64, Int64) |
Grava um evento usando o identificador de evento fornecido e os argumentos 64 bits.Writes an event by using the provided event identifier and 64-bit arguments. |
| WriteEvent(Int32, Int32, Int32, Int32) |
Grava um evento usando o identificador de evento e os argumentos inteiros de 32 bits fornecidos.Writes an event by using the provided event identifier and 32-bit integer arguments. |
| WriteEvent(Int32, String, String) |
Grava um evento usando o identificador de evento e os argumentos de cadeia de caractere fornecidos.Writes an event by using the provided event identifier and string arguments. |
| WriteEvent(Int32, String, Int64) |
Grava um evento usando o identificador de evento fornecido e os argumentos.Writes an event by using the provided event identifier and arguments. |
| WriteEvent(Int32, String, Int32) |
Grava um evento usando o identificador de evento fornecido e os argumentos.Writes an event by using the provided event identifier and arguments. |
| WriteEvent(Int32, Int64, String) |
Grava um evento usando o identificador de evento fornecido e argumentos inteiros de 64 bits e cadeia de caracteres fornecidos.Writes an event by using the provided event identifier and 64-bit integer, and string arguments. |
| WriteEvent(Int32, Int64, Int64) |
Grava um evento usando o identificador de evento fornecido e os argumentos 64 bits.Writes an event by using the provided event identifier and 64-bit arguments. |
| WriteEvent(Int32, Int32, String) |
Grava um evento usando o identificador de evento fornecido e argumentos inteiros de 32 bits e cadeia de caracteres fornecidos.Writes an event by using the provided event identifier and 32-bit integer and string arguments. |
| WriteEvent(Int32, Int32, Int32) |
Grava um evento usando o identificador de evento e os argumentos inteiros de 32 bits fornecidos.Writes an event by using the provided event identifier and 32-bit integer arguments. |
| WriteEvent(Int32, String) |
Grava um evento usando o identificador de evento e o argumentos de cadeia de caractere fornecidos.Writes an event by using the provided event identifier and string argument. |
| WriteEvent(Int32, Object[]) |
Grava um evento usando o identificador de evento fornecido e a matriz de argumentos.Writes an event by using the provided event identifier and array of arguments. |
| WriteEvent(Int32, Int64) |
Grava um evento usando o identificador de evento e o argumento inteiro de 64 bits fornecidos.Writes an event by using the provided event identifier and 64-bit integer argument. |
| WriteEvent(Int32, Int32) |
Grava um evento usando o identificador de evento e o argumento inteiro de 32 bits fornecidos.Writes an event by using the provided event identifier and 32-bit integer argument. |
| WriteEvent(Int32, Byte[]) |
Grava um evento usando o identificador de evento e o argumento de matriz de bytes fornecidos.Writes an event by using the provided event identifier and byte array argument. |
| WriteEvent(Int32) |
Grava um evento usando o identificador de evento fornecido.Writes an event by using the provided event identifier. |
| WriteEvent(Int32, Int64, Byte[]) |
Grava os dados de evento usando o identificador especificado e inteiro de 64 bits e argumentos da matriz de bytes.Writes the event data using the specified identifier and 64-bit integer and byte array arguments. |
Comentários
O WriteEvent método fornece sobrecargas com combinações de argumentos de cadeia de caracteres e inteiros.The WriteEvent method provides overloads with combinations of string and integer arguments. Se nenhuma dessas combinações corresponder aos parâmetros da chamada, o compilador usará a EventSource.WriteEvent(Int32, Object[]) sobrecarga, que é consideravelmente mais lenta do que as outras sobrecargas.If none of these combinations match the parameters for the call, the compiler uses the EventSource.WriteEvent(Int32, Object[]) overload, which is considerably slower than the other overloads. Consulte a página sobrecarga para obter detalhes.See the overload page for details.
Em todos os casos, o eventid parâmetro deve ser maior que 0 ou menor que 65535 ou erros podem ocorrer na operação.In all cases, the eventid parameter should be greater than 0 or less than 65535 or errors can occur in the operation. Se ocorrerem erros, você poderá obter mais informações sobre a origem do erro verificando o fluxo de saída do depurador, se você tiver um depurador anexado aos eventos de acionamento do processo.If errors do occur, you can get more information about the source of the error by checking the output stream of the debugger, if you have a debugger attached to the process firing events. Você também pode procurar erros relatados no fluxo de eventos do ETW, se você tiver um ouvinte ETW na origem do evento em que o erro ocorre.You can also look for errors reported in the ETW event stream, if you have an ETW listener on the event source where the error occurs.
Quando você implementa um método que é identificado como um evento ETW em uma EventSource classe derivada.When you implement a method that is identified as an ETW event in an EventSource-derived class. Você deve chamar o método da classe base WriteEvent passando o EventId e os mesmos argumentos que o método implementado semelhante ao exemplo a seguir.You must call the base class WriteEvent method passing the EventId and the same arguments as the implemented method similar to the following example.
[Event(2, Level = EventLevel.Informational)]
public void Info1(string arg1)
{
base.WriteEvent(2, arg1);
}
Você também pode criar uma sobrecarga personalizada usando o WriteEventCore método.You can also create a custom overload by using the WriteEventCore method.
WriteEvent(Int32, String, String, String)
Grava um evento usando o identificador de evento e os argumentos de cadeia de caractere fornecidos.Writes an event by using the provided event identifier and string arguments.
protected:
void WriteEvent(int eventId, System::String ^ arg1, System::String ^ arg2, System::String ^ arg3);
protected void WriteEvent (int eventId, string arg1, string arg2, string arg3);
protected void WriteEvent (int eventId, string? arg1, string? arg2, string? arg3);
member this.WriteEvent : int * string * string * string -> unit
Protected Sub WriteEvent (eventId As Integer, arg1 As String, arg2 As String, arg3 As String)
Parâmetros
- eventId
- Int32
O identificador de evento.The event identifier. Esse valor deve estar entre 0 e 65535.This value should be between 0 and 65535.
- arg1
- String
Um argumento de cadeia de caracteres.A string argument.
- arg2
- String
Um argumento de cadeia de caracteres.A string argument.
- arg3
- String
Um argumento de cadeia de caracteres.A string argument.
Comentários
eventid deve ser maior que 0 ou menor que 65535 ou erros podem ocorrer na operação.eventid should be greater than 0 or less than 65535 or errors can occur in the operation. Se ocorrerem erros, você poderá obter mais informações sobre a origem do erro verificando o fluxo de saída do depurador, se você tiver um depurador anexado aos eventos de acionamento do processo.If errors do occur, you can get more information about the source of the error by checking the output stream of the debugger, if you have a debugger attached to the process firing events. Você também pode procurar erros relatados no fluxo de eventos do ETW, se você tiver um ouvinte ETW na origem do evento em que o erro ocorre.You can also look for errors reported in the ETW event stream, if you have an ETW listener on the event source where the error occurs.
Quando você implementa um método que é identificado como um evento ETW em uma EventSource classe derivada.When you implement a method that is identified as an ETW event in an EventSource-derived class. Você deve chamar o método da classe base WriteEvent passando o EventId e os mesmos argumentos que o método implementado semelhante ao exemplo a seguir.You must call the base class WriteEvent method passing the EventId and the same arguments as the implemented method similar to the following example.
[Event(2, Level = EventLevel.Informational)]
public void Info1(string arg1)
{
base.WriteEvent(2, arg1);
}
Aplica-se a
WriteEvent(Int32, String, Int32, Int32)
Grava um evento usando o identificador de evento fornecido e os argumentos.Writes an event by using the provided event identifier and arguments.
protected:
void WriteEvent(int eventId, System::String ^ arg1, int arg2, int arg3);
protected void WriteEvent (int eventId, string arg1, int arg2, int arg3);
protected void WriteEvent (int eventId, string? arg1, int arg2, int arg3);
member this.WriteEvent : int * string * int * int -> unit
Protected Sub WriteEvent (eventId As Integer, arg1 As String, arg2 As Integer, arg3 As Integer)
Parâmetros
- eventId
- Int32
O identificador de evento.The event identifier. Esse valor deve estar entre 0 e 65535.This value should be between 0 and 65535.
- arg1
- String
Um argumento de cadeia de caracteres.A string argument.
- arg2
- Int32
Um argumento inteiro de 32 bits.A 32 bit integer argument.
- arg3
- Int32
Um argumento inteiro de 32 bits.A 32 bit integer argument.
Comentários
eventid deve ser maior que 0 ou menor que 65535 ou erros podem ocorrer na operação.eventid should be greater than 0 or less than 65535 or errors can occur in the operation. Se ocorrerem erros, você poderá obter mais informações sobre a origem do erro verificando o fluxo de saída do depurador, se você tiver um depurador anexado aos eventos de acionamento do processo.If errors do occur, you can get more information about the source of the error by checking the output stream of the debugger, if you have a debugger attached to the process firing events. Você também pode procurar erros relatados no fluxo de eventos do ETW, se você tiver um ouvinte ETW na origem do evento em que o erro ocorre.You can also look for errors reported in the ETW event stream, if you have an ETW listener on the event source where the error occurs.
Quando você implementa um método que é identificado como um evento ETW em uma EventSource classe derivada.When you implement a method that is identified as an ETW event in an EventSource-derived class. Você deve chamar o método da classe base WriteEvent passando o EventId e os mesmos argumentos que o método implementado semelhante ao exemplo a seguir.You must call the base class WriteEvent method passing the EventId and the same arguments as the implemented method similar to the following example.
[Event(2, Level = EventLevel.Informational)]
public void Info1(string arg1)
{
base.WriteEvent(2, arg1);
}
Aplica-se a
WriteEvent(Int32, Int64, Int64, Int64)
Grava um evento usando o identificador de evento fornecido e os argumentos 64 bits.Writes an event by using the provided event identifier and 64-bit arguments.
protected:
void WriteEvent(int eventId, long arg1, long arg2, long arg3);
protected void WriteEvent (int eventId, long arg1, long arg2, long arg3);
member this.WriteEvent : int * int64 * int64 * int64 -> unit
Protected Sub WriteEvent (eventId As Integer, arg1 As Long, arg2 As Long, arg3 As Long)
Parâmetros
- eventId
- Int32
O identificador de evento.The event identifier. Esse valor deve estar entre 0 e 65535.This value should be between 0 and 65535.
- arg1
- Int64
Um argumento inteiro de 64 bits.A 64 bit integer argument.
- arg2
- Int64
Um argumento inteiro de 64 bits.A 64 bit integer argument.
- arg3
- Int64
Um argumento inteiro de 64 bits.A 64 bit integer argument.
Comentários
eventid deve ser maior que 0 ou menor que 65535 ou erros podem ocorrer na operação.eventid should be greater than 0 or less than 65535 or errors can occur in the operation. Se ocorrerem erros, você poderá obter mais informações sobre a origem do erro verificando o fluxo de saída do depurador, se você tiver um depurador anexado aos eventos de acionamento do processo.If errors do occur, you can get more information about the source of the error by checking the output stream of the debugger, if you have a debugger attached to the process firing events. Você também pode procurar erros relatados no fluxo de eventos do ETW, se você tiver um ouvinte ETW na origem do evento em que o erro ocorre.You can also look for errors reported in the ETW event stream, if you have an ETW listener on the event source where the error occurs.
Quando você implementa um método que é identificado como um evento ETW em uma EventSource classe derivada.When you implement a method that is identified as an ETW event in an EventSource-derived class. Você deve chamar o método da classe base WriteEvent passando o EventId e os mesmos argumentos que o método implementado semelhante ao exemplo a seguir.You must call the base class WriteEvent method passing the EventId and the same arguments as the implemented method similar to the following example.
[Event(2, Level = EventLevel.Informational)]
public void Info1(string arg1)
{
base.WriteEvent(2, arg1);
}
Aplica-se a
WriteEvent(Int32, Int32, Int32, Int32)
Grava um evento usando o identificador de evento e os argumentos inteiros de 32 bits fornecidos.Writes an event by using the provided event identifier and 32-bit integer arguments.
protected:
void WriteEvent(int eventId, int arg1, int arg2, int arg3);
protected void WriteEvent (int eventId, int arg1, int arg2, int arg3);
member this.WriteEvent : int * int * int * int -> unit
Protected Sub WriteEvent (eventId As Integer, arg1 As Integer, arg2 As Integer, arg3 As Integer)
Parâmetros
- eventId
- Int32
O identificador de evento.The event identifier. Esse valor deve estar entre 0 e 65535.This value should be between 0 and 65535.
- arg1
- Int32
Um argumento inteiro.An integer argument.
- arg2
- Int32
Um argumento inteiro.An integer argument.
- arg3
- Int32
Um argumento inteiro.An integer argument.
Comentários
eventid deve ser maior que 0 ou menor que 65535 ou erros podem ocorrer na operação.eventid should be greater than 0 or less than 65535 or errors can occur in the operation. Se ocorrerem erros, você poderá obter mais informações sobre a origem do erro verificando o fluxo de saída do depurador, se você tiver um depurador anexado aos eventos de acionamento do processo.If errors do occur, you can get more information about the source of the error by checking the output stream of the debugger, if you have a debugger attached to the process firing events. Você também pode procurar erros relatados no fluxo de eventos do ETW, se você tiver um ouvinte ETW na origem do evento em que o erro ocorre.You can also look for errors reported in the ETW event stream, if you have an ETW listener on the event source where the error occurs.
Quando você implementa um método que é identificado como um evento ETW em uma EventSource classe derivada.When you implement a method that is identified as an ETW event in an EventSource-derived class. Você deve chamar o método da classe base WriteEvent passando o EventId e os mesmos argumentos que o método implementado semelhante ao exemplo a seguir.You must call the base class WriteEvent method passing the EventId and the same arguments as the implemented method similar to the following example.
[Event(2, Level = EventLevel.Informational)]
public void Info1(string arg1)
{
base.WriteEvent(2, arg1);
}
Aplica-se a
WriteEvent(Int32, String, String)
Grava um evento usando o identificador de evento e os argumentos de cadeia de caractere fornecidos.Writes an event by using the provided event identifier and string arguments.
protected:
void WriteEvent(int eventId, System::String ^ arg1, System::String ^ arg2);
protected void WriteEvent (int eventId, string arg1, string arg2);
protected void WriteEvent (int eventId, string? arg1, string? arg2);
member this.WriteEvent : int * string * string -> unit
Protected Sub WriteEvent (eventId As Integer, arg1 As String, arg2 As String)
Parâmetros
- eventId
- Int32
O identificador de evento.The event identifier. Esse valor deve estar entre 0 e 65535.This value should be between 0 and 65535.
- arg1
- String
Um argumento de cadeia de caracteres.A string argument.
- arg2
- String
Um argumento de cadeia de caracteres.A string argument.
Comentários
eventid deve ser maior que 0 ou menor que 65535 ou erros podem ocorrer na operação.eventid should be greater than 0 or less than 65535 or errors can occur in the operation. Se ocorrerem erros, você poderá obter mais informações sobre a origem do erro verificando o fluxo de saída do depurador, se você tiver um depurador anexado aos eventos de acionamento do processo.If errors do occur, you can get more information about the source of the error by checking the output stream of the debugger, if you have a debugger attached to the process firing events. Você também pode procurar erros relatados no fluxo de eventos do ETW, se você tiver um ouvinte ETW na origem do evento em que o erro ocorre.You can also look for errors reported in the ETW event stream, if you have an ETW listener on the event source where the error occurs.
Quando você implementa um método que é identificado como um evento ETW em uma EventSource classe derivada.When you implement a method that is identified as an ETW event in an EventSource-derived class. Você deve chamar o método da classe base WriteEvent passando o EventId e os mesmos argumentos que o método implementado semelhante ao exemplo a seguir.You must call the base class WriteEvent method passing the EventId and the same arguments as the implemented method similar to the following example.
[Event(2, Level = EventLevel.Informational)]
public void Info1(string arg1)
{
base.WriteEvent(2, arg1);
}
Aplica-se a
WriteEvent(Int32, String, Int64)
Grava um evento usando o identificador de evento fornecido e os argumentos.Writes an event by using the provided event identifier and arguments.
protected:
void WriteEvent(int eventId, System::String ^ arg1, long arg2);
protected void WriteEvent (int eventId, string arg1, long arg2);
protected void WriteEvent (int eventId, string? arg1, long arg2);
member this.WriteEvent : int * string * int64 -> unit
Protected Sub WriteEvent (eventId As Integer, arg1 As String, arg2 As Long)
Parâmetros
- eventId
- Int32
O identificador de evento.The event identifier. Esse valor deve estar entre 0 e 65535.This value should be between 0 and 65535.
- arg1
- String
Um argumento de cadeia de caracteres.A string argument.
- arg2
- Int64
Um argumento inteiro de 64 bits.A 64 bit integer argument.
Comentários
eventid deve ser maior que 0 ou menor que 65535 ou erros podem ocorrer na operação.eventid should be greater than 0 or less than 65535 or errors can occur in the operation. Se ocorrerem erros, você poderá obter mais informações sobre a origem do erro verificando o fluxo de saída do depurador, se você tiver um depurador anexado aos eventos de acionamento do processo.If errors do occur, you can get more information about the source of the error by checking the output stream of the debugger, if you have a debugger attached to the process firing events. Você também pode procurar erros relatados no fluxo de eventos do ETW, se você tiver um ouvinte ETW na origem do evento em que o erro ocorre.You can also look for errors reported in the ETW event stream, if you have an ETW listener on the event source where the error occurs.
Quando você implementa um método que é identificado como um evento ETW em uma EventSource classe derivada.When you implement a method that is identified as an ETW event in an EventSource-derived class. Você deve chamar o método da classe base WriteEvent passando o EventId e os mesmos argumentos que o método implementado semelhante ao exemplo a seguir.You must call the base class WriteEvent method passing the EventId and the same arguments as the implemented method similar to the following example.
[Event(2, Level = EventLevel.Informational)]
public void Info1(string arg1)
{
base.WriteEvent(2, arg1);
}
Aplica-se a
WriteEvent(Int32, String, Int32)
Grava um evento usando o identificador de evento fornecido e os argumentos.Writes an event by using the provided event identifier and arguments.
protected:
void WriteEvent(int eventId, System::String ^ arg1, int arg2);
protected void WriteEvent (int eventId, string arg1, int arg2);
protected void WriteEvent (int eventId, string? arg1, int arg2);
member this.WriteEvent : int * string * int -> unit
Protected Sub WriteEvent (eventId As Integer, arg1 As String, arg2 As Integer)
Parâmetros
- eventId
- Int32
O identificador de evento.The event identifier. Esse valor deve estar entre 0 e 65535.This value should be between 0 and 65535.
- arg1
- String
Um argumento de cadeia de caracteres.A string argument.
- arg2
- Int32
Um argumento inteiro de 32 bits.A 32 bit integer argument.
Comentários
eventid deve ser maior que 0 ou menor que 65535 ou erros podem ocorrer na operação.eventid should be greater than 0 or less than 65535 or errors can occur in the operation. Se ocorrerem erros, você poderá obter mais informações sobre a origem do erro verificando o fluxo de saída do depurador, se você tiver um depurador anexado aos eventos de acionamento do processo.If errors do occur, you can get more information about the source of the error by checking the output stream of the debugger, if you have a debugger attached to the process firing events. Você também pode procurar erros relatados no fluxo de eventos do ETW, se você tiver um ouvinte ETW na origem do evento em que o erro ocorre.You can also look for errors reported in the ETW event stream, if you have an ETW listener on the event source where the error occurs.
Quando você implementa um método que é identificado como um evento ETW em uma EventSource classe derivada.When you implement a method that is identified as an ETW event in an EventSource-derived class. Você deve chamar o método da classe base WriteEvent passando o EventId e os mesmos argumentos que o método implementado semelhante ao exemplo a seguir.You must call the base class WriteEvent method passing the EventId and the same arguments as the implemented method similar to the following example.
[Event(2, Level = EventLevel.Informational)]
public void Info1(string arg1)
{
base.WriteEvent(2, arg1);
}
Aplica-se a
WriteEvent(Int32, Int64, String)
Grava um evento usando o identificador de evento fornecido e argumentos inteiros de 64 bits e cadeia de caracteres fornecidos.Writes an event by using the provided event identifier and 64-bit integer, and string arguments.
protected:
void WriteEvent(int eventId, long arg1, System::String ^ arg2);
protected void WriteEvent (int eventId, long arg1, string arg2);
protected void WriteEvent (int eventId, long arg1, string? arg2);
member this.WriteEvent : int * int64 * string -> unit
Protected Sub WriteEvent (eventId As Integer, arg1 As Long, arg2 As String)
Parâmetros
- eventId
- Int32
O identificador de evento.The event identifier. Esse valor deve estar entre 0 e 65535.This value should be between 0 and 65535.
- arg1
- Int64
Um argumento inteiro de 64 bits.A 64-bit integer argument.
- arg2
- String
Um argumento de cadeia de caracteres.A string argument.
Comentários
eventid deve ser maior que 0 ou menor que 65535 ou erros podem ocorrer na operação.eventid should be greater than 0 or less than 65535 or errors can occur in the operation. Se ocorrerem erros, você poderá obter mais informações sobre a origem do erro verificando o fluxo de saída do depurador, se você tiver um depurador anexado aos eventos de acionamento do processo.If errors do occur, you can get more information about the source of the error by checking the output stream of the debugger, if you have a debugger attached to the process firing events. Você também pode procurar erros relatados no fluxo de eventos do ETW, se você tiver um ouvinte ETW na origem do evento em que o erro ocorre.You can also look for errors reported in the ETW event stream, if you have an ETW listener on the event source where the error occurs.
Quando você implementa um método que é identificado como um evento ETW em uma EventSource classe derivada.When you implement a method that is identified as an ETW event in an EventSource-derived class. Você deve chamar o método da classe base WriteEvent passando o EventId e os mesmos argumentos que o método implementado semelhante ao exemplo a seguir.You must call the base class WriteEvent method passing the EventId and the same arguments as the implemented method similar to the following example.
[Event(2, Level = EventLevel.Informational)]
public void Info1(Int64 arg1, string arg2)
{
base.WriteEvent(2, arg1, arg2);
}
Aplica-se a
WriteEvent(Int32, Int64, Int64)
Grava um evento usando o identificador de evento fornecido e os argumentos 64 bits.Writes an event by using the provided event identifier and 64-bit arguments.
protected:
void WriteEvent(int eventId, long arg1, long arg2);
protected void WriteEvent (int eventId, long arg1, long arg2);
member this.WriteEvent : int * int64 * int64 -> unit
Protected Sub WriteEvent (eventId As Integer, arg1 As Long, arg2 As Long)
Parâmetros
- eventId
- Int32
O identificador de evento.The event identifier. Esse valor deve estar entre 0 e 65535.This value should be between 0 and 65535.
- arg1
- Int64
Um argumento inteiro de 64 bits.A 64 bit integer argument.
- arg2
- Int64
Um argumento inteiro de 64 bits.A 64 bit integer argument.
Comentários
eventid deve ser maior que 0 ou menor que 65535 ou erros podem ocorrer na operação.eventid should be greater than 0 or less than 65535 or errors can occur in the operation. Se ocorrerem erros, você poderá obter mais informações sobre a origem do erro verificando o fluxo de saída do depurador, se você tiver um depurador anexado aos eventos de acionamento do processo.If errors do occur, you can get more information about the source of the error by checking the output stream of the debugger, if you have a debugger attached to the process firing events. Você também pode procurar erros relatados no fluxo de eventos do ETW, se você tiver um ouvinte ETW na origem do evento em que o erro ocorre.You can also look for errors reported in the ETW event stream, if you have an ETW listener on the event source where the error occurs.
Quando você implementa um método que é identificado como um evento ETW em uma EventSource classe derivada.When you implement a method that is identified as an ETW event in an EventSource-derived class. Você deve chamar o método da classe base WriteEvent passando o EventId e os mesmos argumentos que o método implementado semelhante ao exemplo a seguir.You must call the base class WriteEvent method passing the EventId and the same arguments as the implemented method similar to the following example.
[Event(2, Level = EventLevel.Informational)]
public void Info1(string arg1)
{
base.WriteEvent(2, arg1);
}
Aplica-se a
WriteEvent(Int32, Int32, String)
Grava um evento usando o identificador de evento fornecido e argumentos inteiros de 32 bits e cadeia de caracteres fornecidos.Writes an event by using the provided event identifier and 32-bit integer and string arguments.
protected:
void WriteEvent(int eventId, int arg1, System::String ^ arg2);
protected void WriteEvent (int eventId, int arg1, string arg2);
protected void WriteEvent (int eventId, int arg1, string? arg2);
member this.WriteEvent : int * int * string -> unit
Protected Sub WriteEvent (eventId As Integer, arg1 As Integer, arg2 As String)
Parâmetros
- eventId
- Int32
O identificador de evento.The event identifier. Esse valor deve estar entre 0 e 65535.This value should be between 0 and 65535.
- arg1
- Int32
Um argumento inteiro de 32 bits.A 32-bit integer argument.
- arg2
- String
Um argumento de cadeia de caracteres.A string argument.
Aplica-se a
WriteEvent(Int32, Int32, Int32)
Grava um evento usando o identificador de evento e os argumentos inteiros de 32 bits fornecidos.Writes an event by using the provided event identifier and 32-bit integer arguments.
protected:
void WriteEvent(int eventId, int arg1, int arg2);
protected void WriteEvent (int eventId, int arg1, int arg2);
member this.WriteEvent : int * int * int -> unit
Protected Sub WriteEvent (eventId As Integer, arg1 As Integer, arg2 As Integer)
Parâmetros
- eventId
- Int32
O identificador de evento.The event identifier. Esse valor deve estar entre 0 e 65535.This value should be between 0 and 65535.
- arg1
- Int32
Um argumento inteiro.An integer argument.
- arg2
- Int32
Um argumento inteiro.An integer argument.
Comentários
eventid deve ser maior que 0 ou menor que 65535 ou erros podem ocorrer na operação.eventid should be greater than 0 or less than 65535 or errors can occur in the operation. Se ocorrerem erros, você poderá obter mais informações sobre a origem do erro verificando o fluxo de saída do depurador, se você tiver um depurador anexado aos eventos de acionamento do processo.If errors do occur, you can get more information about the source of the error by checking the output stream of the debugger, if you have a debugger attached to the process firing events. Você também pode procurar erros relatados no fluxo de eventos do ETW, se você tiver um ouvinte ETW na origem do evento em que o erro ocorre.You can also look for errors reported in the ETW event stream, if you have an ETW listener on the event source where the error occurs.
Quando você implementa um método que é identificado como um evento ETW em uma EventSource classe derivada.When you implement a method that is identified as an ETW event in an EventSource-derived class. Você deve chamar o método da classe base WriteEvent passando o EventId e os mesmos argumentos que o método implementado semelhante ao exemplo a seguir.You must call the base class WriteEvent method passing the EventId and the same arguments as the implemented method similar to the following example.
[Event(2, Level = EventLevel.Informational)]
public void Info1(int arg1, int arg2, int arg3)
{
base.WriteEvent(2, arg1);
}
Aplica-se a
WriteEvent(Int32, String)
Grava um evento usando o identificador de evento e o argumentos de cadeia de caractere fornecidos.Writes an event by using the provided event identifier and string argument.
protected:
void WriteEvent(int eventId, System::String ^ arg1);
protected void WriteEvent (int eventId, string arg1);
protected void WriteEvent (int eventId, string? arg1);
member this.WriteEvent : int * string -> unit
Protected Sub WriteEvent (eventId As Integer, arg1 As String)
Parâmetros
- eventId
- Int32
O identificador de evento.The event identifier. Esse valor deve estar entre 0 e 65535.This value should be between 0 and 65535.
- arg1
- String
Um argumento de cadeia de caracteres.A string argument.
Exemplos
O exemplo a seguir mostra como usar essa sobrecarga de método para gravar um evento.The following example shows how to use this method overload to write an event. Este exemplo de código faz parte de um exemplo maior fornecido para a EventSource classe.This code example is part of a larger example provided for the EventSource class.
[Event(1, Message = "Application Failure: {0}", Level = EventLevel.Error, Keywords = Keywords.Diagnostic)]
public void Failure(string message) { WriteEvent(1, message); }
<[Event](1, Message:="Application Failure: {0}", Level:=EventLevel.Error, Keywords:=Keywords.Diagnostic)> _
Public Sub Failure(ByVal message As String)
WriteEvent(1, message)
End Sub
Comentários
eventid deve ser maior que 0 ou menor que 65535 ou erros podem ocorrer na operação.eventid should be greater than 0 or less than 65535 or errors can occur in the operation. Se ocorrerem erros, você poderá obter mais informações sobre a origem do erro verificando o fluxo de saída do depurador, se você tiver um depurador anexado aos eventos de acionamento do processo.If errors do occur, you can get more information about the source of the error by checking the output stream of the debugger, if you have a debugger attached to the process firing events. Você também pode procurar erros relatados no fluxo de eventos do ETW, se você tiver um ouvinte ETW na origem do evento em que o erro ocorre.You can also look for errors reported in the ETW event stream, if you have an ETW listener on the event source where the error occurs.
Quando você implementa um método que é identificado como um evento ETW em uma EventSource classe derivada.When you implement a method that is identified as an ETW event in an EventSource-derived class. Você deve chamar o método da classe base WriteEvent passando o EventId e os mesmos argumentos que o método implementado semelhante ao exemplo a seguir.You must call the base class WriteEvent method passing the EventId and the same arguments as the implemented method similar to the following example.
[Event(2, Level = EventLevel.Informational)]
public void Info1(string arg1)
{
base.WriteEvent(2, arg1);
}
Aplica-se a
WriteEvent(Int32, Object[])
Grava um evento usando o identificador de evento fornecido e a matriz de argumentos.Writes an event by using the provided event identifier and array of arguments.
protected:
void WriteEvent(int eventId, ... cli::array <System::Object ^> ^ args);
protected void WriteEvent (int eventId, params object[] args);
protected void WriteEvent (int eventId, params object?[] args);
member this.WriteEvent : int * obj[] -> unit
Protected Sub WriteEvent (eventId As Integer, ParamArray args As Object())
Parâmetros
- eventId
- Int32
O identificador de evento.The event identifier. Esse valor deve estar entre 0 e 65535.This value should be between 0 and 65535.
- args
- Object[]
Uma matriz de objetos.An array of objects.
Comentários
Por padrão, o compilador chamará essa sobrecarga se os parâmetros para a chamada não corresponderem a uma das outras sobrecargas de método.By default, the compiler calls this overload if the parameters for the call do not match one of the other method overloads. Essa sobrecarga é muito mais lenta do que as outras sobrecargas, pois faz o seguinte:This overload is much slower than the other overloads, because it does the following:
Ele aloca uma matriz para manter o argumento variável.It allocates an array to hold the variable argument.
Ele converte cada parâmetro em um objeto (que causa alocações para tipos primitivos).It casts each parameter to an object (which causes allocations for primitive types).
Ele atribui esses objetos à matriz.It assigns these objects to the array.
Ele chama a função, que determina o tipo de cada argumento para que possa ser serializado para o ETW.It calls the function, which then determines the type of each argument so it can be serialized for ETW.
A sobrecarga alta para essa sobrecarga não é significativa durante o rastreamento de eventos de baixo volume, pois o método é usado somente quando o provedor está habilitado.The high overhead for this overload is not significant when tracing low-volume events, because the method is used only when the provider is enabled. No entanto, para eventos de alto volume, a sobrecarga de desempenho pode ser significativa.However, for high-volume events, the performance overhead can be significant. Você pode evitar EventSource.WriteEvent o uso de cargas de alto volume criando uma sobrecarga nova e mais rápida com o WriteEventCore método.You can avoid using EventSource.WriteEvent for high-volume payloads by creating a new, faster overload with the WriteEventCore method.
eventid deve ser maior que 0 ou menor que 65535 ou erros podem ocorrer na operação.eventid should be greater than 0 or less than 65535 or errors can occur in the operation. Se ocorrerem erros, você poderá obter mais informações sobre a origem do erro verificando o fluxo de saída do depurador, se você tiver um depurador anexado aos eventos de acionamento do processo.If errors do occur, you can get more information about the source of the error by checking the output stream of the debugger, if you have a debugger attached to the process firing events. Você também pode procurar erros relatados no fluxo de eventos do ETW, se você tiver um ouvinte ETW na origem do evento em que o erro ocorre.You can also look for errors reported in the ETW event stream, if you have an ETW listener on the event source where the error occurs.
Quando você implementa um método que é identificado como um evento ETW em uma EventSource classe derivada.When you implement a method that is identified as an ETW event in an EventSource-derived class. Você deve chamar o método da classe base WriteEvent passando o EventId e os mesmos argumentos que o método implementado semelhante ao exemplo a seguir.You must call the base class WriteEvent method passing the EventId and the same arguments as the implemented method similar to the following example.
[Event(2, Level = EventLevel.Informational)]
public void Info1(string arg1)
{
base.WriteEvent(2, arg1);
}
Aplica-se a
WriteEvent(Int32, Int64)
Grava um evento usando o identificador de evento e o argumento inteiro de 64 bits fornecidos.Writes an event by using the provided event identifier and 64-bit integer argument.
protected:
void WriteEvent(int eventId, long arg1);
protected void WriteEvent (int eventId, long arg1);
member this.WriteEvent : int * int64 -> unit
Protected Sub WriteEvent (eventId As Integer, arg1 As Long)
Parâmetros
- eventId
- Int32
O identificador de evento.The event identifier. Esse valor deve estar entre 0 e 65535.This value should be between 0 and 65535.
- arg1
- Int64
Um argumento inteiro de 64 bits.A 64 bit integer argument.
Comentários
eventid deve ser maior que 0 ou menor que 65535 ou erros podem ocorrer na operação.eventid should be greater than 0 or less than 65535 or errors can occur in the operation. Se ocorrerem erros, você poderá obter mais informações sobre a origem do erro verificando o fluxo de saída do depurador, se você tiver um depurador anexado aos eventos de acionamento do processo.If errors do occur, you can get more information about the source of the error by checking the output stream of the debugger, if you have a debugger attached to the process firing events. Você também pode procurar erros relatados no fluxo de eventos do ETW, se você tiver um ouvinte ETW na origem do evento em que o erro ocorre.You can also look for errors reported in the ETW event stream, if you have an ETW listener on the event source where the error occurs.
Quando você implementa um método que é identificado como um evento ETW em uma EventSource classe derivada.When you implement a method that is identified as an ETW event in an EventSource-derived class. Você deve chamar o método da classe base WriteEvent passando o EventId e os mesmos argumentos que o método implementado semelhante ao exemplo a seguir.You must call the base class WriteEvent method passing the EventId and the same arguments as the implemented method similar to the following example.
[Event(2, Level = EventLevel.Informational)]
public void Info1(string arg1)
{
base.WriteEvent(2, arg1);
}
Aplica-se a
WriteEvent(Int32, Int32)
Grava um evento usando o identificador de evento e o argumento inteiro de 32 bits fornecidos.Writes an event by using the provided event identifier and 32-bit integer argument.
protected:
void WriteEvent(int eventId, int arg1);
protected void WriteEvent (int eventId, int arg1);
member this.WriteEvent : int * int -> unit
Protected Sub WriteEvent (eventId As Integer, arg1 As Integer)
Parâmetros
- eventId
- Int32
O identificador de evento.The event identifier. Esse valor deve estar entre 0 e 65535.This value should be between 0 and 65535.
- arg1
- Int32
Um argumento inteiro.An integer argument.
Exemplos
O exemplo a seguir mostra como usar essa sobrecarga de método para gravar um evento.The following example shows how to use this method overload to write an event. Este exemplo de código faz parte de um exemplo maior fornecido para a EventSource classe.This code example is part of a larger example provided for the EventSource class.
[Event(4, Opcode = EventOpcode.Stop, Task = Tasks.Page, Keywords = Keywords.Page, Level = EventLevel.Informational)]
public void PageStop(int ID) { if (IsEnabled()) WriteEvent(4, ID); }
<[Event](4, Opcode:=EventOpcode.Stop, Task:=Tasks.Page, Keywords:=Keywords.Page, Level:=EventLevel.Informational)> _
Public Sub PageStop(ByVal ID As Integer)
If IsEnabled() Then
WriteEvent(4, ID)
End If
End Sub
Comentários
eventid deve ser maior que 0 ou menor que 65535 ou erros podem ocorrer na operação.eventid should be greater than 0 or less than 65535 or errors can occur in the operation. Se ocorrerem erros, você poderá obter mais informações sobre a origem do erro verificando o fluxo de saída do depurador, se você tiver um depurador anexado aos eventos de acionamento do processo.If errors do occur, you can get more information about the source of the error by checking the output stream of the debugger, if you have a debugger attached to the process firing events. Você também pode procurar erros relatados no fluxo de eventos do ETW, se você tiver um ouvinte ETW na origem do evento em que o erro ocorre.You can also look for errors reported in the ETW event stream, if you have an ETW listener on the event source where the error occurs.
Quando você implementa um método que é identificado como um evento ETW em uma EventSource classe derivada.When you implement a method that is identified as an ETW event in an EventSource-derived class. Você deve chamar o método da classe base WriteEvent passando o EventId e os mesmos argumentos que o método implementado semelhante ao exemplo a seguir.You must call the base class WriteEvent method passing the EventId and the same arguments as the implemented method similar to the following example.
[Event(2, Level = EventLevel.Informational)]
public void Info1(int arg1)
{
base.WriteEvent(2, arg1);
}
Aplica-se a
WriteEvent(Int32, Byte[])
Grava um evento usando o identificador de evento e o argumento de matriz de bytes fornecidos.Writes an event by using the provided event identifier and byte array argument.
protected:
void WriteEvent(int eventId, cli::array <System::Byte> ^ arg1);
protected void WriteEvent (int eventId, byte[] arg1);
protected void WriteEvent (int eventId, byte[]? arg1);
member this.WriteEvent : int * byte[] -> unit
Protected Sub WriteEvent (eventId As Integer, arg1 As Byte())
Parâmetros
- eventId
- Int32
O identificador de evento.The event identifier. Esse valor deve estar entre 0 e 65535.This value should be between 0 and 65535.
- arg1
- Byte[]
Um argumento de matriz de bytes.A byte array argument.
Comentários
eventid deve ser maior que 0 ou menor que 65535 ou erros podem ocorrer na operação.eventid should be greater than 0 or less than 65535 or errors can occur in the operation. Se ocorrerem erros, você poderá obter mais informações sobre a origem do erro verificando o fluxo de saída do depurador, se você tiver um depurador anexado aos eventos de acionamento do processo.If errors do occur, you can get more information about the source of the error by checking the output stream of the debugger, if you have a debugger attached to the process firing events. Você também pode procurar erros relatados no fluxo de eventos do ETW, se você tiver um ouvinte ETW na origem do evento em que o erro ocorre.You can also look for errors reported in the ETW event stream, if you have an ETW listener on the event source where the error occurs.
Quando você implementa um método que é identificado como um evento ETW em uma EventSource classe derivada.When you implement a method that is identified as an ETW event in an EventSource-derived class. Você deve chamar o método da classe base WriteEvent passando o EventId e os mesmos argumentos que o método implementado semelhante ao exemplo a seguir.You must call the base class WriteEvent method passing the EventId and the same arguments as the implemented method similar to the following example.
[Event(2, Level = EventLevel.Informational)]
public void Info1(byte[] arg1)
{
base.WriteEvent(2, arg1);
}
Aplica-se a
WriteEvent(Int32)
Grava um evento usando o identificador de evento fornecido.Writes an event by using the provided event identifier.
protected:
void WriteEvent(int eventId);
protected void WriteEvent (int eventId);
member this.WriteEvent : int -> unit
Protected Sub WriteEvent (eventId As Integer)
Parâmetros
- eventId
- Int32
O identificador de evento.The event identifier. Esse valor deve estar entre 0 e 65535.This value should be between 0 and 65535.
Exemplos
O exemplo a seguir mostra como usar essa sobrecarga de método para gravar um evento.The following example shows how to use this method overload to write an event. Este exemplo de código faz parte de um exemplo maior fornecido para a EventSource classe.This code example is part of a larger example provided for the EventSource class.
[Event(1, Message = "Application Failure: {0}", Level = EventLevel.Error, Keywords = Keywords.Diagnostic)]
public void Failure(string message) { WriteEvent(1, message); }
<[Event](1, Message:="Application Failure: {0}", Level:=EventLevel.Error, Keywords:=Keywords.Diagnostic)> _
Public Sub Failure(ByVal message As String)
WriteEvent(1, message)
End Sub
Comentários
eventid deve ser maior que 0 ou menor que 65535 ou erros podem ocorrer na operação.eventid should be greater than 0 or less than 65535 or errors can occur in the operation. Se ocorrerem erros, você poderá obter mais informações sobre a origem do erro verificando o fluxo de saída do depurador, se você tiver um depurador anexado aos eventos de acionamento do processo.If errors do occur, you can get more information about the source of the error by checking the output stream of the debugger, if you have a debugger attached to the process firing events. Você também pode procurar erros relatados no fluxo de eventos do ETW, se você tiver um ouvinte ETW na origem do evento em que o erro ocorre.You can also look for errors reported in the ETW event stream, if you have an ETW listener on the event source where the error occurs.
Quando você implementa um método que é identificado como um evento ETW em uma EventSource classe derivada.When you implement a method that is identified as an ETW event in an EventSource-derived class. Você deve chamar o método da classe base WriteEvent passando o EventId e os mesmos argumentos que o método implementado semelhante ao exemplo a seguir.You must call the base class WriteEvent method passing the EventId and the same arguments as the implemented method similar to the following example.
[Event(2, Level = EventLevel.Informational)]
public void Info1(string arg1)
{
base.WriteEvent(2, arg1);
}
Aplica-se a
WriteEvent(Int32, Int64, Byte[])
Grava os dados de evento usando o identificador especificado e inteiro de 64 bits e argumentos da matriz de bytes.Writes the event data using the specified identifier and 64-bit integer and byte array arguments.
protected:
void WriteEvent(int eventId, long arg1, cli::array <System::Byte> ^ arg2);
protected void WriteEvent (int eventId, long arg1, byte[] arg2);
protected void WriteEvent (int eventId, long arg1, byte[]? arg2);
member this.WriteEvent : int * int64 * byte[] -> unit
Protected Sub WriteEvent (eventId As Integer, arg1 As Long, arg2 As Byte())
Parâmetros
- eventId
- Int32
O identificador de evento.The event identifier. Esse valor deve estar entre 0 e 65535.This value should be between 0 and 65535.
- arg1
- Int64
Um argumento inteiro de 64 bits.A 64-bit integer argument.
- arg2
- Byte[]
Um argumento de matriz de bytes.A byte array argument.
Comentários
eventid deve ser maior que 0 ou menor que 65535 ou erros podem ocorrer na operação.eventid should be greater than 0 or less than 65535 or errors can occur in the operation. Se ocorrerem erros, você poderá obter mais informações sobre a origem do erro verificando o fluxo de saída do depurador, se você tiver um depurador anexado aos eventos de acionamento do processo.If errors do occur, you can get more information about the source of the error by checking the output stream of the debugger, if you have a debugger attached to the process firing events. Você também pode procurar erros relatados no fluxo de eventos do ETW, se você tiver um ouvinte ETW na origem do evento em que o erro ocorre.You can also look for errors reported in the ETW event stream, if you have an ETW listener on the event source where the error occurs.
Quando você implementa um método que é identificado como um evento ETW em uma EventSource classe derivada.When you implement a method that is identified as an ETW event in an EventSource-derived class. Você deve chamar o método da classe base WriteEvent passando o EventId e os mesmos argumentos que o método implementado semelhante ao exemplo a seguir.You must call the base class WriteEvent method passing the EventId and the same arguments as the implemented method similar to the following example.
[Event(2, Level = EventLevel.Informational)]
public void Info1(Int64 arg1, Byte[] arg2)
{
base.WriteEvent(2, arg1, arg2);
}