EventLogEntryCollection.Count プロパティ
アセンブリ: System (system.dll 内)

現時点でイベント ログに存在するエントリの数。

EventLogEntryCollection は、ログのすべてのエントリの動的なリストを表します。したがって、作成した EventLogEntryCollection インスタンスの有効期間内に、Count を変更できます。通常、値を変数に割り当てるよりも、Count プロパティを直接使用する方が便利です。

' Create a new EventLog object. Dim myEventLog1 As New EventLog() myEventLog1.Log = myLogName ' Obtain the Log Entries of the Event Log Dim myEventLogEntryCollection As EventLogEntryCollection = myEventLog1.Entries Console.WriteLine("The number of entries in 'MyNewLog' = " + _ myEventLogEntryCollection.Count.ToString()) ' Display the 'Message' property of EventLogEntry. Dim i As Integer For i = 0 To myEventLogEntryCollection.Count - 1 Console.WriteLine("The Message of the EventLog is :" + _ myEventLogEntryCollection(i).Message) Next i
// Create a new EventLog object. EventLog myEventLog1 = new EventLog(); myEventLog1.Log = myLogName; // Obtain the Log Entries of the Event Log EventLogEntryCollection myEventLogEntryCollection=myEventLog1.Entries; Console.WriteLine("The number of entries in 'MyNewLog' = "+ myEventLogEntryCollection.Count); // Display the 'Message' property of EventLogEntry. for(int i=0;i<myEventLogEntryCollection.Count;i++) { Console.WriteLine("The Message of the EventLog is :"+ myEventLogEntryCollection[i].Message); }
// Create a new EventLog object. EventLog^ myEventLog1 = gcnew EventLog; myEventLog1->Log = myLogName; // Obtain the Log Entries of the Event Log EventLogEntryCollection^ myEventLogEntryCollection = myEventLog1->Entries; Console::WriteLine( "The number of entries in 'MyNewLog' = {0}", myEventLogEntryCollection->Count ); // Display the 'Message' property of EventLogEntry. for ( int i = 0; i < myEventLogEntryCollection->Count; i++ ) { Console::WriteLine( "The Message of the EventLog is : {0}", myEventLogEntryCollection[ i ]->Message ); }
// Create a new EventLog object. EventLog myEventLog1 = new EventLog(); myEventLog1.set_Log(myLogName); // Obtain the Log Entries of the Event Log EventLogEntryCollection myEventLogEntryCollection = myEventLog1.get_Entries(); Console.WriteLine("The number of entries in 'MyNewLog' = " + myEventLogEntryCollection.get_Count()); // Display the 'Message' property of EventLogEntry. for (int i = 0; i < myEventLogEntryCollection.get_Count(); i++) { Console.WriteLine("The Message of the EventLog is :" + myEventLogEntryCollection.get_Item(i).get_Message()); }

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からEventLogEntryCollection.Count プロパティを検索する場合は、下記のリンクをクリックしてください。

- EventLogEntryCollection.Count プロパティのページへのリンク