admin管理员组文章数量:1289911
I use OperatingSystem.IsWindows() method. However, I'm not sure about the behavior when the application is running on a virtual machine. Does it use virtual machine's operating system, or PC's operating system?
I use OperatingSystem.IsWindows() method. However, I'm not sure about the behavior when the application is running on a virtual machine. Does it use virtual machine's operating system, or PC's operating system?
Share Improve this question asked Feb 20 at 11:21 MuratMurat 1186 bronze badges 01 Answer
Reset to default 4It actually doesn't even check anything at runtime. It just returns true
or false
depending on the target of the .NET CLR that the application is using.
From the source code:
[NonVersionable]
public static bool IsWindows() =>
#if TARGET_WINDOWS
true;
#else
false;
#endif
本文标签: cNET OperatingSystem class behavior in virtual machineStack Overflow
版权声明:本文标题:c# - .NET OperatingSystem class behavior in virtual machine - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741439718a2378841.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论