ServiceInstallerDialog.Resultとは?

辞典・百科事典の検索サービス - Weblio辞書

初めての方へ

参加元一覧


用語解説|全文検索

.NET Framework クラス ライブラリ リファレンス

日本マイクロソフト株式会社日本マイクロソフト株式会社

ServiceInstallerDialog.Result プロパティ

サービス アカウント フォームダイアログ ボックス結果取得します。

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

Public ReadOnly Property
 Result As ServiceInstallerDialogResult
Dim instance As ServiceInstallerDialog
Dim value As ServiceInstallerDialogResult

value = instance.Result
public ServiceInstallerDialogResult Result { get;
 }
public:
property ServiceInstallerDialogResult Result {
    ServiceInstallerDialogResult get ();
}
/** @property */
public ServiceInstallerDialogResult get_Result ()
public function get Result
 () : ServiceInstallerDialogResult

プロパティ
ダイアログ ボックス対すユーザー応答を示す ServiceInstallerDialogResult。既定値OK です。

解説解説

ShowDialog を使用してサービス インストール アカウント入力ユーザー要求してから、Result の値を確認してください。この値が OK場合は、入力値 Username と Password が有効であることを検証してください

.NET Framework のセキュリティ.NET Frameworkセキュリティ
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

ServiceInstallerDialogResult 列挙体

ServiceInstallerDialog フォーム戻り値指定します。

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

Public Enumeration ServiceInstallerDialogResult
Dim instance As ServiceInstallerDialogResult
public enum ServiceInstallerDialogResult
public enum class ServiceInstallerDialogResult
public enum ServiceInstallerDialogResult
public enum ServiceInstallerDialogResult
メンバメンバ
 メンバ説明
Canceledダイアログ戻り値Canceled です。通常、この値はユーザーアカウントフィールド設定せずにダイアログキャンセルして終了したことを示します。 
OKダイアログ戻り値OK です。通常、この値はユーザーアカウントプロパティ確認し、[OK] ボタン押してダイアログを閉じたことを示します。 
UseSystemユーザー アカウントではなくシステム アカウント使用してサービスインストールします。通常、この値はダイアログユーザー表示されなかったことを示します。たとえば、ServiceProcessInstaller.Account プロパティUser 以外に設定されています。 
解説解説
使用例使用

ServiceInstallerDialog使用して、ユーザーサービス インストール アカウント入力するように要求するプロンプト表示する例を次に示します。

// Prompt the user for service installation account values.
public static bool GetServiceAccount(ref
 ServiceProcessInstaller svcInst)
{
    bool accountSet = false;
    ServiceInstallerDialog svcDialog = new ServiceInstallerDialog();

    // Query the user for the service account type.
    do
    {
        svcDialog.TopMost = true;
        svcDialog.ShowDialog();

        if (svcDialog.Result == ServiceInstallerDialogResult.OK)
        {
            // Do a very simple validation on the user
            // input.  Check to see whether the user name
            // or password is blank.

            if ((svcDialog.Username.Length > 0) &&
                (svcDialog.Password.Length > 0)   )
            {
                // Use the account and password.
                accountSet = true;

                svcInst.Account = ServiceAccount.User;
                svcInst.Username = svcDialog.Username;
                svcInst.Password = svcDialog.Password;
            }
        }
        else if (svcDialog.Result == ServiceInstallerDialogResult.UseSystem)
        {
            svcInst.Account = ServiceAccount.LocalSystem;
            svcInst.Username = null;
            svcInst.Password = null;
            accountSet  = true;
        }
            
        if (!accountSet )
        {
            // Display a message box.  Tell the user to
            // enter a valid user and password, or cancel
            // out to leave the service account alone.
            DialogResult result;
            result = MessageBox.Show("Invalid user name or password for
 service installation."+
                                     "  Press Cancel to leave the service account
 unchanged.",
                                     "Change Service Account", 
                                     MessageBoxButtons.OKCancel,
                                     MessageBoxIcon.Hand);

            if (result == DialogResult.Cancel)
            {
                // Break out of loop.
                break;
            }
        }
    } while (!accountSet);

    return accountSet;
}
   // Prompt the user for service installation account values.
public:
   static bool GetServiceAccount( interior_ptr<ServiceProcessInstaller^>
 svcInst )
   {
      bool accountSet = false;
      ServiceInstallerDialog^ svcDialog = gcnew ServiceInstallerDialog;

      // Query the user for the service account type.
      do
      {
         svcDialog->TopMost = true;
         svcDialog->ShowDialog();
         if ( svcDialog->Result == ServiceInstallerDialogResult::OK
 )
         {
            // Do a very simple validation on the user
            // input.  Check to see whether the user name
            // or password is blank.
            if ( (svcDialog->Username->Length > 0) &&
 (svcDialog->Password->Length > 0) )
            {
               // Use the account and password.
               accountSet = true;
               ( *svcInst)->Account = ServiceAccount::User;
               ( *svcInst)->Username = svcDialog->Username;
               ( *svcInst)->Password = svcDialog->Password;
            }
         }
         else
         if ( svcDialog->Result == ServiceInstallerDialogResult::UseSystem
 )
         {
            ( *svcInst)->Account = ServiceAccount::LocalSystem;
            ( *svcInst)->Username = nullptr;
            ( *svcInst)->Password = nullptr;
            accountSet = true;
         }

         if (  !accountSet )
         {
            // Display a message box.  Tell the user to
            // enter a valid user and password, or cancel
            // out to leave the service account alone.
            DialogResult result;
            result = MessageBox::Show( "Invalid user name or password for
 service installation."
                  "  Press Cancel to leave the service account unchanged.",
 "Change Service Account", 
                  MessageBoxButtons::OKCancel, MessageBoxIcon::Hand );
            if ( result == DialogResult::Cancel )
            {
               // Break out of loop.
               break;
            }
         }
      }
      while (  !accountSet );

      return accountSet;
   }
// Prompt the user for service installation account values.
public static boolean GetServiceAccount(ServiceProcessInstaller
 svcInst)
{
    boolean accountSet = false;
    ServiceInstallerDialog svcDialog = new ServiceInstallerDialog();
    // Query the user for the service account type.
    do {
        svcDialog.set_TopMost(true);
        svcDialog.ShowDialog();

        if (svcDialog.get_Result().Equals(ServiceInstallerDialogResult.OK))
        {
            // Do a very simple validation on the user
            // input.  Check to see whether the user name
            // or password is blank.
            if (svcDialog.get_Username().get_Length() > 0 
                && svcDialog.get_Password().get_Length() > 0) {
                // Use the account and password.
                accountSet = true;

                svcInst.set_Account(ServiceAccount.User);
                svcInst.set_Username(svcDialog.get_Username());
                svcInst.set_Password(svcDialog.get_Password());
            }
        }
        else {
            if (svcDialog.get_Result().Equals(ServiceInstallerDialogResult.
                UseSystem)) {
                svcInst.set_Account(ServiceAccount.LocalSystem);
                svcInst.set_Username(null);
                svcInst.set_Password(null);
                accountSet = true;
            }
        }

        if (!(accountSet)) {
            // Display a message box.  Tell the user to
            // enter a valid user and password, or cancel
            // out to leave the service account alone.
            DialogResult result;
            result = MessageBox.Show("Invalid user name or password for
 "
                + "service installation." 
                + "  Press Cancel to leave the service account unchanged.",
 
                "Change Service Account", 
                MessageBoxButtons.OKCancel, MessageBoxIcon.Hand);

            if (result.Equals(DialogResult.Cancel)) {
                // Break out of loop.
                break;
            }
        }
    } while (!(accountSet));
    return accountSet;
} //GetServiceAccount
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照





ServiceInstallerDialog.Resultのページへのリンク
「ServiceInstallerDialog.Result」の関連用語
ServiceInstallerDialog.Resultのお隣キーワード
モバイル
モバイル版のWeblioは、下記のURLからアクセスしてください。
http://m.weblio.jp/
_ _   


ServiceInstallerDialog.Resultのページの著作権
Weblio 辞書情報提供元は参加元一覧にて確認できます。

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

©2012 Weblio RSS