2024-09-30c# - - - .net core 判断程序运行的环境,Windows环境或Linux环境或MacOs环境c#.netcore判断程序运行的环境,Windows环境或Linux环境或MacOs环境Codeif(RuntimeInformation.IsOSPlatform(OSPlatform.Linux)){//Linux}elseif(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)){//Windows}elseif(RuntimeInformation.IsOSPlatform(OSPlatfo