operatingsystem.iswindows()方法。但是,我不确定应用程序在虚拟机上运行时的行为。 它使用虚拟机的操作系统还是PC的操作系统?
true
或
false
。
::
[NonVersionable] public static bool IsWindows() => #if TARGET_WINDOWS true; #else false; #endif