0
点赞
收藏
分享

微信扫一扫

c# - - - .net core 判断程序运行的环境,Windows环境或Linux环境或MacOs环境

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
}
举报

相关推荐

0 条评论