public static Runtime GetRunningRuntime() { Type t = Type.GetType("Mono.Runtime"); if (t != null) return Runtime.Mono; else return Runtime.Windows; }