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

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

EventSourceCreationData.Source プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

イベント ソースとしてイベント ログ登録する名前を取得または設定します

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

解説解説
使用例使用例

コマンド ライン引数からイベント ソース構成プロパティ設定するコード例次に示します入力引数は、イベント ソース名、イベント ログ名、コンピュータ名、およびイベント メッセージ リソース ファイル指定します。このコード例は、EventSourceCreationData クラストピック取り上げているコード例一部分です。

Dim mySourceData As EventSourceCreationData
 = new EventSourceCreationData("",
 "")
Dim registerSource As Boolean
 = True

' Process input parameters.
If args.Length > 0
    ' Require at least the source name.

    mySourceData.Source = args(0)

    If args.Length > 1
   
        mySourceData.LogName = args(1)
    
    End If
    If args.Length > 2
   
        mySourceData.MachineName = args(2)
    
    End If
    If args.Length > 3 AndAlso args(3).Length
 > 0
   
        mySourceData.MessageResourceFile = args(3)
    
    End If

Else 
    ' Display a syntax help message.
    Console.WriteLine("Input:")
    Console.WriteLine(" source [event log] [machine name] [resource
 file]")

    registerSource = False
End If

' Set defaults for parameters missing input.
If mySourceData.MachineName.Length = 0

    ' Default to the local computer.
    mySourceData.MachineName = "."
End If
If mySourceData.LogName.Length = 0
    ' Default to the Application log.
    mySourceData.LogName = "Application"
End If
EventSourceCreationData mySourceData = new EventSourceCreationData("",
 "");
bool registerSource = true;

// Process input parameters.
if (args.Length > 0)
{
    // Require at least the source name.

    mySourceData.Source = args[0];

    if (args.Length > 1)
    {
        mySourceData.LogName = args[1];
    }

    if (args.Length > 2)
    {
        mySourceData.MachineName = args[2];
    }
    if ((args.Length > 3) && (args[3].Length > 0))
    {
        mySourceData.MessageResourceFile = args[3];
    }
}
else 
{
    // Display a syntax help message.
    Console.WriteLine("Input:");
    Console.WriteLine(" source [event log] [machine name] [resource file]");

    registerSource = false;
}

// Set defaults for parameters missing input.
if (mySourceData.MachineName.Length == 0)
{
    // Default to the local computer.
    mySourceData.MachineName = ".";
}
if (mySourceData.LogName.Length == 0)
{
    // Default to the Application log.
    mySourceData.LogName = "Application";
}
EventSourceCreationData ^ mySourceData = gcnew EventSourceCreationData( "",""
 );
bool registerSource = true;

// Process input parameters.
if ( args->Length > 1 )
{
   
   // Require at least the source name.
   mySourceData->Source = args[ 1 ];
   if ( args->Length > 2 )
   {
      mySourceData->LogName = args[ 2 ];
   }

   if ( args->Length > 3 )
   {
      mySourceData->MachineName = args[ 3 ];
   }

   if ( (args->Length > 4) && (args[ 4 ]->Length
 > 0) )
   {
      mySourceData->MessageResourceFile = args[ 4 ];
   }
}
else
{
   
   // Display a syntax help message.
   Console::WriteLine( "Input:" );
   Console::WriteLine( " source [event log] [machine name] [resource file]"
 );
   registerSource = false;
}


// Set defaults for parameters missing input.
if ( mySourceData->MachineName->Length == 0 )
{
   
   // Default to the local computer.
   mySourceData->MachineName = ".";
}

if ( mySourceData->LogName->Length == 0 )
{
   
   // Default to the Application log.
   mySourceData->LogName = "Application";
}


.NET Framework のセキュリティ.NET Frameworkセキュリティ
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
EventSourceCreationData クラス
EventSourceCreationData メンバ
System.Diagnostics 名前空間
EventLogInstaller.Source プロパティ
EventLog.SourceExists


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

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

辞書ショートカット

すべての辞書の索引

「EventSourceCreationData.Source プロパティ」の関連用語

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

   

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



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

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

©2025 GRAS Group, Inc.RSS