←Select platform

SetStartMode(ServiceController,ServiceStartModeExtended) Method

Summary

A method that can be used to set the start mode for a Windows Service to Automatic, Manual, Disabled or Automatic (Delayed Start).

Syntax
C#
C++/CLI
public static void SetStartMode( 
   this ServiceController serviceController, 
   ServiceStartModeExtended mode 
) 
public:  
   [ExtensionAttribute] 
   static void SetStartMode( 
      ServiceController^ serviceController, 
      ServiceStartModeExtended^ mode 
   ) 

Parameters

serviceController

A ServiceController that references a Windows service.

mode

A ServiceStartModeExtended representing the service start mode.

Remarks

A DICOM Listening Service (i.e., the process running Leadtools.Dicom.Server.exe) is a windows service that processes DICOM messages.

A specific DICOM listening service (or any windows service) is configured to have a startup type:

Start mode Description
Automatic The DICOM listening service automatically starts during the boot and logon process.
Manual The DICOM listening service does not automatically start during boot and logon, but may be launched by Windows if needed.
Disabled Use this setting to disable the DICOM listening service. Disabling the service prevents the service from starting.
AutomaticDelayedStart Similar to Automatic, except the DICOM listening service is briefly delayed during the logon process to increase logon performance.
Example
C#
using Leadtools.Dicom.AddIn; 
using Leadtools.Dicom.AddIn.Common; 
using Leadtools.Dicom.Server.Admin; 
 
 
public static void Example_ServerControllerExtensions() 
{ 
   using (ServiceController sc = new ServiceController("L22_PACS_SCP64")) 
   { 
      // Set start modes using constants 
      sc.SetStartMode(ServiceStartModeExtended.Disabled); 
      sc.SetStartMode(ServiceStartModeExtended.Manual); 
      sc.SetStartMode(ServiceStartModeExtended.Automatic); 
      sc.SetStartMode(ServiceStartModeExtended.AutomaticDelayedStart); 
 
      // Set start modes using strings 
      sc.SetStartMode("Disabled"); 
      sc.SetStartMode("Manual"); 
      sc.SetStartMode("Automatic"); 
      sc.SetStartMode("AutomaticDelayedStart"); 
   } 
} 
Requirements

Target Platforms

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Dicom.Server.Admin Assembly

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.