WindowsServiceHelpers.IsWindowsService 方法

定义

检查当前进程是否作为 Windows 服务进行托管。Check if the current process is hosted as a Windows Service.

public:
 static bool IsWindowsService();
public static bool IsWindowsService ();
static member IsWindowsService : unit -> bool
Public Shared Function IsWindowsService () As Boolean

返回

Boolean

如果当前进程是作为 Windows 服务进行托管,则为 true;否则为 falsetrue if the current process is hosted as a Windows Service; otherwise, false.

适用于