Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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));
- }
- }
- }
Add Comment
Please, Sign In to add comment