InstallContext.Parameters プロパティ
アセンブリ: System.Configuration.Install (system.configuration.install.dll 内)

インストール実行可能ファイルの実行時に入力されたコマンド ライン パラメータを表す StringDictionary。


この例は、InstallContext クラスの概要で紹介されているクラスの例からの抜粋です。
Parameters プロパティを取得して、ユーザーがコマンド ライン引数を入力したかどうかを確認するサンプルを次に示します。このサンプルでは、LogtoConsole パラメータが設定されているかどうかを確認するために、IsParameterTrue メソッドも使用します。yes の場合、これは LogMessage メソッドを使用してステータス メッセージをインストール ログ ファイルとコンソールに書き込みます。
Dim myStringDictionary As StringDictionary = myInstallContext.Parameters If myStringDictionary.Count = 0 Then Console.WriteLine("No parameters have been entered in the command line" + _ "hence, the install will take place in the silent mode") Else ' Check wether the "LogtoConsole" parameter has been set. If myInstallContext.IsParameterTrue("LogtoConsole") = True Then ' Display the message to the console and add it to the logfile. myInstallContext.LogMessage("The 'Install' method has been called") End If End If
StringDictionary myStringDictionary = myInstallContext.Parameters; if( myStringDictionary.Count == 0 ) { Console.WriteLine( "No parameters have been entered in the command line " +"hence, the install will take place in the silent mode" ); } else { // Check whether the "LogtoConsole" parameter has been set. if( myInstallContext.IsParameterTrue( "LogtoConsole" ) == true ) { // Display the message to the console and add it to the logfile. myInstallContext.LogMessage( "The 'Install' method has been called" ); } }
StringDictionary^ myStringDictionary = myInstallContext->Parameters; if ( myStringDictionary->Count == 0 ) { Console::Write( "No parameters have been entered in the command line " ); Console::WriteLine( "hence, the install will take place in the silent mode" ); } else { // Check whether the "LogtoConsole" parameter has been set. if ( myInstallContext->IsParameterTrue( "LogtoConsole" ) ) { // Display the message to the console and add it to the logfile. myInstallContext->LogMessage( "The 'Install' method has been called" ); } }
StringDictionary myStringDictionary = myInstallContext.get_Parameters(); if (myStringDictionary.get_Count() == 0) { Console.WriteLine("No parameters have been entered in the command " +"line hence, the install will take place in the silent mode"); } else { // Check whether the "LogtoConsole" parameter has been set. if (myInstallContext.IsParameterTrue("LogtoConsole") == true) { // Display the message to the console and add it //to the logfile. myInstallContext.LogMessage( "The 'Install' method has been called"); } }


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


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

- InstallContext.Parameters プロパティのページへのリンク