public static string GetMonoRuntimeVersion()
{
Type type = Type.GetType("Mono.Runtime");
if (type != null)
{
MethodInfo displayName = type.GetMethod("GetDisplayName");
if (displayName != null)
{
var version = (string)displayName.Invoke(null, null);
// Replace "/" from the version string as it's a
// seperator in the user agent format
version = version.Replace("/", ":").Replace(" ",string.Empty);
return "Mono/" + version;
}
}
return UnknownMonoVersion;
}