Added some debug only features and target windows only

This commit is contained in:
Andrew Lee 2021-01-09 11:44:29 -05:00
parent 2115d78c52
commit 8f8ed50342
2 changed files with 7 additions and 1 deletions

View file

@ -2,7 +2,9 @@
<PropertyGroup> <PropertyGroup>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net5.0-windows</TargetFramework>
<Authors>Andrew Lee</Authors>
<Copyright>(C) Copyright 2021 Andrew Lee</Copyright>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View file

@ -7,9 +7,13 @@ namespace FakeCMD
{ {
static void Main(string[] args) static void Main(string[] args)
{ {
#if DEBUG
Console.WriteLine("You are running .NET {0}", Environment.Version.ToString());
#endif
RegistryKey registryKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion"); RegistryKey registryKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion");
var buildNumber = registryKey.GetValue("UBR").ToString(); var buildNumber = registryKey.GetValue("UBR").ToString();
Console.WriteLine($"Microsoft Windows [Version {buildNumber}]"); Console.WriteLine($"Microsoft Windows [Version {buildNumber}]");
Console.ReadLine();
} }
} }
} }