WindowsServiceHelpers.IsWindowsService 方法

定义

检查当前进程是否作为 Windows 服务进行托管。

public:
 static bool IsWindowsService();
[System.Runtime.Versioning.SupportedOSPlatformGuard("windows")]
public static bool IsWindowsService ();
public static bool IsWindowsService ();
[<System.Runtime.Versioning.SupportedOSPlatformGuard("windows")>]
static member IsWindowsService : unit -> bool
static member IsWindowsService : unit -> bool
Public Shared Function IsWindowsService () As Boolean

返回

如果当前进程是作为 Windows 服务进行托管,则为 true;否则为 false

属性

适用于