SirCmpwn

Untitled

May 5th, 2012
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.IO;
  6.  
  7. namespace DcpuDevDE
  8. {
  9. public static class RuntimeInfo
  10. {
  11. public static bool IsMono { get; private set; }
  12. public static bool IsWindows { get; private set; }
  13. public static bool IsLinux { get; private set; }
  14. public static bool IsMacOSX { get; private set; }
  15.  
  16. internal static void GatherInfo()
  17. {
  18. IsMono = Type.GetType("Mono.Runtime") != null;
  19. int p = (int)Environment.OSVersion.Platform;
  20. IsLinux = (p == 4) || (p == 6) || (p == 128);
  21. IsWindows = Path.DirectorySeparatorChar == '\\';
  22. IsMacOSX = Environment.OSVersion.Platform == PlatformID.MacOSX;
  23. }
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment