mirror of
https://github.com/markjprice/cs11dotnet7.git
synced 2026-04-06 14:53:47 +00:00
Initial commit
This commit is contained in:
parent
d0eb68594c
commit
c0d4d11b54
24 changed files with 463 additions and 0 deletions
21
vs4win/Chapter07/DotNetEverywhere/Program.cs
Normal file
21
vs4win/Chapter07/DotNetEverywhere/Program.cs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
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();
|
||||
Loading…
Add table
Add a link
Reference in a new issue