Para ver el artículo en inglés, active la casilla Inglés. También puede ver el texto en inglés en una ventana emergente si pasa el puntero del mouse por el texto.
|
Traducción
Inglés
|
EventLogEntry (Clase)
System.MarshalByRefObject
System.ComponentModel.Component
System.Diagnostics.EventLogEntry
Ensamblado: System (en System.dll)
El tipo EventLogEntry expone los siguientes miembros.
Nombre | Descripción | |
---|---|---|
![]() | CanRaiseEvents | |
![]() | Category | |
![]() | CategoryNumber | |
![]() | Container | |
![]() | Data | |
![]() | DesignMode | |
![]() | EntryType | |
![]() | EventID | Obsoleto. |
![]() | Events | |
![]() | Index | |
![]() | InstanceId | |
![]() | MachineName | |
![]() | Message | |
![]() | ReplacementStrings | |
![]() | Site | |
![]() | Source | |
![]() | TimeGenerated | |
![]() | TimeWritten | |
![]() | UserName |
Nombre | Descripción | |
---|---|---|
![]() | CreateObjRef | |
![]() | Dispose() | |
![]() | Dispose(Boolean) | |
![]() | Equals(EventLogEntry) | |
![]() | Equals(Object) | |
![]() | Finalize | |
![]() | GetHashCode | |
![]() | GetLifetimeService | |
![]() | GetService | |
![]() | GetType | |
![]() | InitializeLifetimeService | |
![]() | MemberwiseClone() | |
![]() | MemberwiseClone(Boolean) | |
![]() | ToString |
Nombre | Descripción | |
---|---|---|
![]() ![]() | ISerializable.GetObjectData | Infraestructura. |
Nota de la plataforma :
using System; using System.Diagnostics; class MyEventlogClass { public static void Main() { String myEventType=null; // Associate the instance of 'EventLog' with local System Log. EventLog myEventLog = new EventLog("System", "."); Console.WriteLine("1:Error"); Console.WriteLine("2:Information"); Console.WriteLine("3:Warning"); Console.WriteLine("Select the Event Type"); int myOption=Convert.ToInt32(Console.ReadLine()); switch(myOption) { case 1: myEventType="Error"; break; case 2: myEventType="Information"; break; case 3: myEventType="Warning"; break; default: break; } EventLogEntryCollection myLogEntryCollection=myEventLog.Entries; int myCount =myLogEntryCollection.Count; // Iterate through all 'EventLogEntry' instances in 'EventLog'. for(int i=myCount-1;i>0;i--) { EventLogEntry myLogEntry = myLogEntryCollection[i]; // Select the entry having desired EventType. if(myLogEntry.EntryType.ToString().Equals(myEventType)) { // Display Source of the event. Console.WriteLine(myLogEntry.Source +" was the source of last event of type " +myLogEntry.EntryType); return; } } } }
Windows 7, Windows Vista SP1 o posterior, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (no se admite Server Core), Windows Server 2008 R2 (se admite Server Core con SP1 o posterior), Windows Server 2003 SP2
.NET Framework no admite todas las versiones de todas las plataformas. Para obtener una lista de las versiones compatibles, vea Requisitos de sistema de .NET Framework.