如何检测,如果我的应用程序在虚拟机上运行?我的、机上、应用程序

2023-09-02 11:47:58 作者:雅俗共赏

如何检测(.NET或Win32的),如果我的应用程序在虚拟机上运行?

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

推荐答案

根据虚拟PC专家的博客文章 检测Microsoft虚拟机的,您可以使用WMI检查的制造商母板。在PowerShell中:

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"