Code
using System;
using System.Runtime.InteropServices;
namespace TestDemo01
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
Console.WriteLine($"Linux:{ RuntimeInformation.IsOSPlatform(OSPlatform.Linux) }");
Console.WriteLine($"Windows:{ RuntimeInformation.IsOSPlatform(OSPlatform.Windows) }");
Console.WriteLine($"OSX:{ RuntimeInformation.IsOSPlatform(OSPlatform.OSX) }");
Console.ReadKey();
}
}
}