ServiceController.ServiceName Propriété
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Obtient ou définit le nom qui identifie le service référencé par cette instance.
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
Valeur de propriété
Nom qui identifie le service référencé par cette ServiceController instance. La valeur par défaut est une chaîne vide ( » « ).
- Attributs
Exceptions
ServiceName a la valeur null.
La syntaxe de la ServiceName propriété n’est pas valide.
Le service n’a pas été trouvé.
Remarques
Identifie ServiceName le service au Gestionnaire de contrôle de service. La modification de cette propriété entraîne la liaison de l’instance ServiceController à un autre service, mais elle ne modifie pas ce que le composant logiciel enfichable Microsoft Management Console de Service Control Manager affiche.
Lorsque vous implémentez un service personnalisé, la valeur de cette propriété doit être identique au nom enregistré pour le service dans la ServiceName propriété de la classe correspondante ServiceInstaller . Dans le code, le ServiceName fichier est généralement défini dans la main() fonction de l’exécutable.
Lorsque vous réinitialisez la ServiceName propriété, la méthode qui définit la propriété définit les valeurs de DisplayName cette instance sur une chaîne vide ( » « ).