ServiceAccount 列挙体とは? わかりやすく解説

ServiceAccount 列挙体

サービスセキュリティ コンテキスト指定します。このコンテキストにより、そのサービスログオン種類定義されます。

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

Dim instance As ServiceAccount
public enum ServiceAccount
public enum class ServiceAccount
public enum ServiceAccount
public enum ServiceAccount
メンバメンバ
解説解説
使用例使用例
Imports System
Imports System.Collections
Imports System.Configuration.Install
Imports System.ServiceProcess
Imports System.ComponentModel

<RunInstallerAttribute(True)> _
Public Class MyProjectInstaller
    Inherits Installer
    Private serviceInstaller1 As ServiceInstaller
    Private serviceInstaller2 As ServiceInstaller
    Private processInstaller As ServiceProcessInstaller
    
    
    Public Sub New()
        ' Instantiate installers for process and services.
        processInstaller = New ServiceProcessInstaller()
        serviceInstaller1 = New ServiceInstaller()
        serviceInstaller2 = New ServiceInstaller()
        
        ' The services will run under the system account.
        processInstaller.Account = ServiceAccount.LocalSystem
        
        ' The services will be started manually.
        serviceInstaller1.StartType = ServiceStartMode.Manual
        serviceInstaller2.StartType = ServiceStartMode.Manual
        
        ' ServiceName must equal those on ServiceBase derived classes.
            
        serviceInstaller1.ServiceName = "Hello-World Service 1"
        serviceInstaller2.ServiceName = "Hello-World Service 2"
        
        ' Add installers to collection. Order is not important.
        Installers.Add(serviceInstaller1)
        Installers.Add(serviceInstaller2)
        Installers.Add(processInstaller)
    End Sub
End Class

using System;
using System.Collections;
using System.Configuration.Install;
using System.ServiceProcess;
using System.ComponentModel;

[RunInstallerAttribute(true)]
public class MyProjectInstaller: Installer{
   private ServiceInstaller serviceInstaller1;
   private ServiceInstaller serviceInstaller2;
   private ServiceProcessInstaller processInstaller;

   public MyProjectInstaller(){
      // Instantiate installers for process and services.
      processInstaller = new ServiceProcessInstaller();
      serviceInstaller1 = new ServiceInstaller();
      serviceInstaller2 = new ServiceInstaller();

      // The services run under the system account.
      processInstaller.Account = ServiceAccount.LocalSystem;

      // The services are started manually.
      serviceInstaller1.StartType = ServiceStartMode.Manual;
      serviceInstaller2.StartType = ServiceStartMode.Manual;

      // ServiceName must equal those on ServiceBase derived classes.
            
      serviceInstaller1.ServiceName = "Hello-World Service 1";
      serviceInstaller2.ServiceName = "Hello-World Service 2";

      // Add installers to collection. Order is not important.
      Installers.Add(serviceInstaller1);
      Installers.Add(serviceInstaller2);
      Installers.Add(processInstaller);
   }
}

#using <System.dll>
#using <System.ServiceProcess.dll>
#using <System.Configuration.Install.dll>

using namespace System;
using namespace System::Collections;
using namespace System::Configuration::Install;
using namespace System::ServiceProcess;
using namespace System::ComponentModel;

[RunInstallerAttribute(true)]
public ref class MyProjectInstaller: public
 Installer
{
private:
   ServiceInstaller^ serviceInstaller1;
   ServiceInstaller^ serviceInstaller2;
   ServiceProcessInstaller^ processInstaller;

public:
   MyProjectInstaller()
   {
      
      // Instantiate installers for process and services.
      processInstaller = gcnew ServiceProcessInstaller;
      serviceInstaller1 = gcnew ServiceInstaller;
      serviceInstaller2 = gcnew ServiceInstaller;
      
      // The services run under the system account.
      processInstaller->Account = ServiceAccount::LocalSystem;
      
      // The services are started manually.
      serviceInstaller1->StartType = ServiceStartMode::Manual;
      serviceInstaller2->StartType = ServiceStartMode::Manual;
      
      // ServiceName must equal those on ServiceBase derived classes.
            
      serviceInstaller1->ServiceName = "Hello-World Service 1";
      serviceInstaller2->ServiceName = "Hello-World Service 2";
      
      // Add installers to collection. Order is not important.
      Installers->Add( serviceInstaller1 );
      Installers->Add( serviceInstaller2 );
      Installers->Add( processInstaller );
   }

};

import System.*;
import System.Collections.*;
import System.Configuration.Install.*;
import System.ServiceProcess.*;
import System.ComponentModel.*;

/** @attribute RunInstallerAttribute(true)
 */
public class MyProjectInstaller extends Installer
{
    private ServiceInstaller serviceInstaller1;
    private ServiceInstaller serviceInstaller2;
    private ServiceProcessInstaller processInstaller;

    public MyProjectInstaller()
    {
        // Instantiate installers for process and services.
        processInstaller = new ServiceProcessInstaller();
        serviceInstaller1 = new ServiceInstaller();
        serviceInstaller2 = new ServiceInstaller();

        // The services run under the system account.
        processInstaller.set_Account(ServiceAccount.LocalSystem);

        // The services are started manually.
        serviceInstaller1.set_StartType(ServiceStartMode.Manual);
        serviceInstaller2.set_StartType(ServiceStartMode.Manual);

        // ServiceName must equal those on ServiceBase derived classes.
            
        serviceInstaller1.set_ServiceName("Hello-World Service 1");
        serviceInstaller2.set_ServiceName("Hello-World Service 2");

        // Add installers to collection. Order is not important.
        get_Installers().Add(serviceInstaller1);
        get_Installers().Add(serviceInstaller2);
        get_Installers().Add(processInstaller);
    } //MyProjectInstaller
} //MyProjectInstaller
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
System.ServiceProcess 名前空間
ServiceProcessInstaller
ServiceInstallerDialog



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

辞書ショートカット

すべての辞書の索引

「ServiceAccount 列挙体」の関連用語

ServiceAccount 列挙体のお隣キーワード
検索ランキング

   

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



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

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

©2024 GRAS Group, Inc.RSS