Guest User

Untitled

a guest
Jul 15th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. using System;
  2. using System.Reflection;
  3.  
  4. public class PrintDotNetVersionInfo {
  5. public static void Main(string[] args) {
  6. PrintVersionInfo();
  7. }
  8.  
  9. public static void PrintVersionInfo() {
  10. Console.WriteLine(".NET Version: " + System.Environment.Version.ToString());
  11. var mono = Type.GetType("Mono.Runtime", false, true);
  12. if (mono == null)
  13. Console.WriteLine("Runtime: Microsoft .NET");
  14. else {
  15. Console.WriteLine("Runtime: Mono {0}",
  16. mono.GetMethod("GetDisplayName", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, null));
  17. }
  18. }
  19. }
Add Comment
Please, Sign In to add comment