private static string GetVariable(string name)
{
var retval = Environment.GetEnvironmentVariable(name);
if (retval == null)
{
var propertyInfo = typeof (Environment).GetProperty(name, BindingFlags.Static | BindingFlags.Public);
if (propertyInfo != null)
{
retval = (string)propertyInfo.GetValue(null, null);
}
}
return retval;
}
}