How to check the OS version at runtime, e.g. on Windows or Linux, without using a conditional compilation statement

后端 未结 7 1108
生来不讨喜
生来不讨喜 2020-11-28 08:57

How do I determine what platform my C# code is running on? for example whether it is running on Linux or windows so that I can execute different code at runtime.

I h

7条回答
提交回复
热议问题