Created
November 27, 2010 21:44
-
-
Save beccasaurus/718307 to your computer and use it in GitHub Desktop.
PrintDotNetVersionInfo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Reflection; | |
public class PrintDotNetVersionInfo { | |
public static void Main(string[] args) { | |
PrintVersionInfo(); | |
} | |
public static void PrintVersionInfo() { | |
Console.WriteLine(".NET Version: " + System.Environment.Version.ToString()); | |
var mono = Type.GetType("Mono.Runtime", false, true); | |
if (mono == null) | |
Console.WriteLine("Runtime: Microsoft .NET"); | |
else { | |
Console.WriteLine("Runtime: Mono {0}", | |
mono.GetMethod("GetDisplayName", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, null)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment