mirror of
https://github.com/markjprice/cs11dotnet7.git
synced 2025-12-06 05:32:03 +01:00
22 lines
473 B
C#
22 lines
473 B
C#
WriteLine("I can run everywhere!");
|
|
WriteLine($"OS Version is {Environment.OSVersion}.");
|
|
|
|
if (OperatingSystem.IsMacOS())
|
|
{
|
|
WriteLine("I am macOS.");
|
|
}
|
|
else if (OperatingSystem.IsWindowsVersionAtLeast(major: 10, build: 22000))
|
|
{
|
|
WriteLine("I am Windows 11.");
|
|
}
|
|
else if (OperatingSystem.IsWindowsVersionAtLeast(major: 10))
|
|
{
|
|
WriteLine("I am Windows 10.");
|
|
}
|
|
else
|
|
{
|
|
WriteLine("I am some other mysterious OS.");
|
|
}
|
|
WriteLine("Press ENTER to stop me.");
|
|
ReadLine();
|