c# .net core 判断程序运行的环境,Windows环境或Linux环境或MacOs环境
Code
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{//Linux
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{//Windows
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{//OSX
}
标签:core,程序运行,OSPlatform,Windows,环境,RuntimeInformation,Linux,IsOSPlatform
From: https://blog.51cto.com/zicl/12156430