EventLogEntryCollection.Item プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > EventLogEntryCollection.Item プロパティの意味・解説 

EventLogEntryCollection.Item プロパティ

0 から始まるインデックス基づいてイベント ログのエントリを取得します

名前空間: System.Diagnostics
アセンブリ: System (system.dll 内)
構文構文

Public Overridable ReadOnly
 Default Property Item ( _
    index As Integer _
) As EventLogEntry
Dim instance As EventLogEntryCollection
Dim index As Integer
Dim value As EventLogEntry

value = instance(index)
public virtual EventLogEntry this [
    int index
] { get; }
public:
virtual property EventLogEntry^ default [int]
 {
    EventLogEntry^ get (int index);
}
/** @property */
public EventLogEntry get_Item (int index)

パラメータ

index

イベント ログ エントリに関連付けられた、0 から始まるインデックス

プロパティ
index パラメータ指定した位置にあるイベント ログ エントリ。

解説解説

EventLogEntry オブジェクトには、オブジェクトイベント ログ到達した順に、イベント ログ システムによってインデックス割り当てられます。このプロパティ使用してコレクション内のインデックス認識している特定のイベント ログ エントリを選択します

EventLogEntryCollection インスタンス反復処理して、各 EventLogEntry オブジェクトに順にアクセスます。EventLogEntryCollection インスタンス関連付けられたエントリに順にアクセスして、エントリのセット全体チェックするには、for(int i=0; i<count, i++) ループではなく for each...next ループ使用します。これは、コレクション動的であり、ループ時にエントリ数が変化する可能性があるためです。

新しいエントリは既存リスト末尾追加されるため、コレクションを順に処理していけば、最初に EventLogEntryCollection作成した後で作成されたエントリにもアクセスできます

使用例使用例
' 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());
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
EventLogEntryCollection クラス
EventLogEntryCollection メンバ
System.Diagnostics 名前空間
EventLogEntryCollection.Count プロパティ


このページでは「.NET Framework クラス ライブラリ リファレンス」からEventLogEntryCollection.Item プロパティを検索した結果を表示しています。
Weblioに収録されているすべての辞書からEventLogEntryCollection.Item プロパティを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からEventLogEntryCollection.Item プロパティ を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「EventLogEntryCollection.Item プロパティ」の関連用語

EventLogEntryCollection.Item プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



EventLogEntryCollection.Item プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS