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

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

EventLog.LogDisplayName プロパティ

イベント ログ表示名取得します

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

Dim instance As EventLog
Dim value As String

value = instance.LogDisplayName
public string LogDisplayName { get;
 }
public:
property String^ LogDisplayName {
    String^ get ();
}
/** @property */
public String get_LogDisplayName ()
public function get LogDisplayName
 () : String

プロパティ
システムイベント ビューアイベント ログを表す名前。

例外例外
例外種類条件

Exception

MachineName プロパティ指定されコンピュータにはログがありません。

SystemException

このイベント ログ関連付けられたレジストリ キーアプリケーションで開くことができませんでした

使用例使用例
Dim myRemoteMachine As String
Dim myLogName as string
 = "MyLog"
Console.Write("Enter computer on which to create log : ")
myRemoteMachine = Console.ReadLine()

' Check if the source exists.
if not EventLog.SourceExists("MyTestSource")
 then
   'Create source.
   EventLog.CreateEventSource("MyTestSource", myLogName
,myRemoteMachine)
   Console.WriteLine("Creating EventSource")
else
   'Get the EventLog associated if the source exists.
   myLogName = EventLog.LogNameFromSourceName("MyTestSource"
,myRemoteMachine)
end if

Dim myEventLog1 As New EventLog(myLogName,
 myRemoteMachine)
myEventLog1.Source = "MyTestSource"
' Write an entry into log.
myEventLog1.WriteEntry("This is for your information",
 _
                     EventLogEntryType.SuccessAudit, 100)
Console.WriteLine("An EventLog created on computer "
 + myEventLog1.MachineName)
Console.Write("Enter remote computer on which to create log :
 ")
myRemoteMachine = Console.ReadLine()

Dim myEventLog2 As New EventLog()
myEventLog2.MachineName = myRemoteMachine
myEventLog2.Source = "MyTestSource"
myEventLog2.Log = myEventLog1.LogDisplayName
myEventLog2.WriteEntry("This is for your information")
Console.WriteLine("An EventLog created on computer "
 + myEventLog2.MachineName)
string myRemoteMachine;
string myLogName = "MyLog";

Console.Write( "Enter computer on which to create log : " );
myRemoteMachine = Console.ReadLine();

// Check if the source exists.
if(!EventLog.SourceExists("MyTestSource"))
{
   //Create source.
   EventLog.CreateEventSource("MyTestSource", myLogName,myRemoteMachine);
   Console.WriteLine("Creating EventSource");
}
else
   // Get the EventLog associated if the source exists.
   myLogName = EventLog.LogNameFromSourceName("MyTestSource",myRemoteMachine);

EventLog myEventLog1 = new EventLog(myLogName,myRemoteMachine);
myEventLog1.Source = "MyTestSource";
// Write an entry into log.
myEventLog1.WriteEntry("This is for your information"
,
                               EventLogEntryType.SuccessAudit,100);
Console.WriteLine("An EventLog created on computer "+ 
                               myEventLog1.MachineName);

Console.Write( "Enter remote computer on which to create log : " );
myRemoteMachine = Console.ReadLine();

EventLog myEventLog2 = new EventLog();
myEventLog2.MachineName = myRemoteMachine;
myEventLog2.Source = "MyTestSource";
myEventLog2.Log = myEventLog1.LogDisplayName;
myEventLog2.WriteEntry("This is for your information");
Console.WriteLine("An EventLog created on computer "+ 
                                   myEventLog2.MachineName);
String^ myRemoteMachine;
String^ myLogName = "MyLog";

Console::Write( "Enter computer on which to create log : " );
myRemoteMachine = Console::ReadLine();

// Check if the source exists.
if (  !EventLog::SourceExists( "MyTestSource" ) )
{
   //Create source.
   EventLog::CreateEventSource( "MyTestSource", myLogName, myRemoteMachine
 );
   Console::WriteLine( "Creating EventSource" );
}
else
      myLogName = EventLog::LogNameFromSourceName( "MyTestSource", myRemoteMachine
 );

// Get the EventLog associated if the source exists.
EventLog^ myEventLog1 = gcnew EventLog( myLogName,myRemoteMachine );
myEventLog1->Source = "MyTestSource";

// Write an entry into log.
myEventLog1->WriteEntry( "This is for your information"
,
   EventLogEntryType::SuccessAudit, 100 );
Console::WriteLine( "An EventLog created on computer {0}",
   myEventLog1->MachineName );

Console::Write( "Enter remote computer on which to create log : " );
myRemoteMachine = Console::ReadLine();

EventLog^ myEventLog2 = gcnew EventLog;
myEventLog2->MachineName = myRemoteMachine;
myEventLog2->Source = "MyTestSource";
myEventLog2->Log = myEventLog1->LogDisplayName;
myEventLog2->WriteEntry( "This is for your information"
 );
Console::WriteLine( "An EventLog created on computer {0}",
   myEventLog2->MachineName );
String myRemoteMachine;
String myLogName = "MyLog";

Console.Write("Enter computer on which to create log : ");
myRemoteMachine = Console.ReadLine();

// Check if the source exists.
if (!(EventLog.SourceExists("MyTestSource"))) {
    //Create source.
    EventLog.CreateEventSource("MyTestSource",
        myLogName, myRemoteMachine);
    Console.WriteLine("Creating EventSource");
}                
else {
    // Get the EventLog associated if the source exists.
    myLogName = EventLog.LogNameFromSourceName("MyTestSource",
        myRemoteMachine);
}

EventLog myEventLog1 = new EventLog(myLogName, myRemoteMachine);

myEventLog1.set_Source("MyTestSource");

// Write an entry into log.
myEventLog1.WriteEntry("This is for your information"
,
    EventLogEntryType.SuccessAudit, 100);
Console.WriteLine("An EventLog created on computer " 
    + myEventLog1.get_MachineName());
Console.Write("Enter remote computer on which to create log : ");
myRemoteMachine = Console.ReadLine();
EventLog myEventLog2 = new EventLog();
myEventLog2.set_MachineName(myRemoteMachine);
myEventLog2.set_Source("MyTestSource");
myEventLog2.set_Log(myEventLog1.get_LogDisplayName());
myEventLog2.WriteEntry("This is for your information");
Console.WriteLine("An EventLog created on computer " 
    + myEventLog2.get_MachineName());
.NET Framework のセキュリティ.NET Frameworkセキュリティ
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


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

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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2025 GRAS Group, Inc.RSS