ServiceController.ServiceName 속성

정의

이 인스턴스가 참조하는 서비스를 식별하는 이름을 가져오거나 설정합니다.

public:
 property System::String ^ ServiceName { System::String ^ get(); void set(System::String ^ value); };
public:
 property System::String ^ ServiceName { System::String ^ get(); };
public string ServiceName { get; set; }
public string ServiceName { get; }
[System.ComponentModel.TypeConverter(typeof(System.ServiceProcess.Design.ServiceNameConverter))]
[System.ServiceProcess.ServiceProcessDescription("SPServiceName")]
public string ServiceName { get; set; }
[System.ComponentModel.TypeConverter(typeof(System.ServiceProcess.Design.ServiceNameConverter))]
[System.ServiceProcess.ServiceProcessDescription("SPServiceName")]
[System.ComponentModel.SettingsBindable(true)]
public string ServiceName { get; set; }
member this.ServiceName : string with get, set
member this.ServiceName : string
[<System.ComponentModel.TypeConverter(typeof(System.ServiceProcess.Design.ServiceNameConverter))>]
[<System.ServiceProcess.ServiceProcessDescription("SPServiceName")>]
member this.ServiceName : string with get, set
[<System.ComponentModel.TypeConverter(typeof(System.ServiceProcess.Design.ServiceNameConverter))>]
[<System.ServiceProcess.ServiceProcessDescription("SPServiceName")>]
[<System.ComponentModel.SettingsBindable(true)>]
member this.ServiceName : string with get, set
Public Property ServiceName As String
Public ReadOnly Property ServiceName As String

속성 값

String

ServiceController 인스턴스가 참조하는 서비스를 식별하는 이름입니다. 기본값은 빈 문자열("")입니다.

특성

예외

ServiceName 속성의 구문이 잘못된 경우

서비스를 찾을 수 없습니다.

설명

서비스 ServiceName 제어 관리자에 대한 서비스를 식별합니다. 이 속성을 변경하면 인스턴스가 ServiceController 다른 서비스에 바인딩됩니다. 서비스 제어 관리자의 Microsoft 관리 콘솔 스냅인 디스플레이는 변경되지 않습니다.

사용자 지정 서비스를 구현하는 경우 이 속성의 값은 해당 ServiceInstaller 클래스의 속성에 ServiceName 있는 서비스에 대해 기록된 이름과 동일해야 합니다. 코드 ServiceName 에서는 일반적으로 실행 파일의 함수에서 main() 설정됩니다.

속성을 다시 ServiceName 설정할 때 속성을 설정하는 메서드는 이 인스턴스를 DisplayName 빈 문자열("")로 설정합니다.

적용 대상