Determining if the program is running on Windows Server

前端 未结 5 371
北恋
北恋 2020-12-03 04:06

I would like to determine if my program is running on a version of Windows Server. Apparently, System.Environment does not contain information about the fact th

5条回答
  •  攒了一身酷
    2020-12-03 04:09

    IsWindowsServer is an inline function in VersionHelpers.h.

    You can find and read that header file on your computer. It uses the API function VerifyVersionInfoW.

    There is no function IswindowsServer in kernel32.dll.

提交回复
热议问题