How to detect if my application is running in a virtual machine?

前端 未结 10 1294
青春惊慌失措
青春惊慌失措 2020-11-28 05:52

How can I detect (.NET or Win32) if my application is running in a virtual machine?

10条回答
  •  一向
    一向 (楼主)
    2020-11-28 06:00

    According to Virtual PC Guy's blog post "Detecting Microsoft virtual machines", you can use WMI to check the manufacturer of the motherboard. In PowerShell:

     (gwmi Win32_BaseBoard).Manufacturer -eq "Microsoft Corporation"
    

提交回复
热议问题