我有一个适用于 Linux 和 Windows 的应用程序。我需要知道应用程序在哪里工作以使用差异代码。谢谢
最佳答案
您可能正在寻找 System.Runtime.InteropServices.RuntimeInformation
与 IsOsPlatform
函数进行运行时检查。
有看视频教程https://channel9.msdn.com/Series/aspnetmonsters/ASPNET-Monsters-Episode-46-Finding-Platform-Information的 ASP.NET 怪物。
关于asp.net-core - 如何获取有关运行时 .Net Core 的信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39207282/