<summary>
Get the browser-side operating system name
</summary>
<returns></returns>
public static string Getosname ()
{
string osVersion = System.Web.HttpContext.Current.Request.Browser.Platform;
string useragent = System.Web.HttpContext.Current.Request.UserAgent;
if (Useragent.contains ("NT 6.2"))
{
OsVersion = "Windows8/server 2012";
}
if (Useragent.contains ("NT 6.1"))
{
OsVersion = "Windows7/server R2";
}
else if (useragent.contains ("NT 6.0"))
{
OsVersion = "Windows vista/server 2008";
}
else if (useragent.contains ("NT 5.2"))
{
OsVersion = "Windows Server 2003";
}
else if (useragent.contains ("NT 5.1"))
{
OsVersion = "WindowsXP";
}
else if (Useragent.contains ("NT 5"))
{
OsVersion = "Windows2000";
}
else if (Useragent.contains ("NT 4"))
{
OsVersion = "WindowsNT4.0";
}
else if (Useragent.contains ("Me"))
{
OsVersion = "Windowsme";
}
else if (Useragent.contains ("98"))
{
OsVersion = "Windows98";
}
else if (Useragent.contains ("95"))
{
OsVersion = "Windows95";
}
else if (Useragent.contains ("Mac"))
{
OsVersion = "Mac";
}
else if (Useragent.contains ("Unix"))
{
OsVersion = "UNIX";
}
else if (Useragent.contains ("Linux"))
{
OsVersion = "Linux";
}
else if (Useragent.contains ("SunOS"))
{
OsVersion = "SunOS";
}
return osVersion;
}
ASP. NET get browser-side operating system name