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

EventLog.Log プロパティ

読み取るログまたは書き込むログの名前を取得または設定します

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

解説解説
使用例使用例

ローカル コンピュータ上のイベント ログ "NewEventLog" のエントリを読み取る例を次に示します

Imports System
Imports System.Diagnostics
Imports Microsoft.VisualBasic

Class MySample
    Public Shared Sub Main()
        Dim myNewLog As New
 EventLog()
        myNewLog.Log = "NewEventLog"
        Dim entry As EventLogEntry
        For Each entry In
  myNewLog.Entries
            Console.WriteLine((ControlChars.Tab & "Entry:
 " & entry.Message))
        Next entry
    End Sub 'Main
End Class 'MySample
using System;
using System.Diagnostics;
              
class MySample{

    public static void Main(){

        EventLog myNewLog = new EventLog();
        myNewLog.Log = "NewEventLog";                      
        foreach(EventLogEntry entry in myNewLog.Entries){
            Console.WriteLine("\tEntry: " + entry.Message);
        }    
    }       
}
   
#using <System.dll>

using namespace System;
using namespace System::Diagnostics;
int main()
{
   EventLog^ myNewLog = gcnew EventLog;
   myNewLog->Log = "NewEventLog";
   System::Collections::IEnumerator^ myEnum = myNewLog->Entries->GetEnumerator();
   while ( myEnum->MoveNext() )
   {
      EventLogEntry^ entry = safe_cast<EventLogEntry^>(myEnum->Current);
      Console::WriteLine( "\tEntry: {0}", entry->Message );
   }
}

import System.*;
import System.Diagnostics.*;
import System.Collections.*;

class MySample
{
    public static void main(String[]
 args)
    {
        EventLog myNewLog = new EventLog();
        myNewLog.set_Log("NewEventLog");       
        EventLogEntry entry;
        IEnumerator objEnum = myNewLog.get_Entries().GetEnumerator();
        while (objEnum.MoveNext()) {
            entry = (EventLogEntry)objEnum.get_Current();
            Console.WriteLine("\tEntry: " + entry.get_Message());
        }
    } //main
} //MySample
.NET Framework のセキュリティ.NET Frameworkセキュリティ
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
EventLog クラス
EventLog メンバ
System.Diagnostics 名前空間
MachineName
Source
EventLog.Entries プロパティ
Exists
Delete
CreateEventSource
EventLogEntryCollection


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

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

辞書ショートカット

すべての辞書の索引

「EventLog.Log プロパティ」の関連用語











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

   

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



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

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

©2025 GRAS Group, Inc.RSS