OperatingSystem os = Environment.OSVersion;
var platform = os.Platform.ToString();
var version = os.Version.ToString();
var servicePack = os.ServicePack.ToString();
You can also find with the help of user agent.
String userAgent = Request.UserAgent;
if (userAgent.IndexOf("Windows NT 6.3") > 0)
{
//Windows 8.1
}
else if (userAgent.IndexOf("Windows NT 6.2") > 0)
{
//Windows 8
}
else if (userAgent.IndexOf("Windows NT 6.1") > 0)
{
//Windows 7
}
else if (userAgent.IndexOf("Windows NT 6.0") > 0)
{
//Windows Vista
}
else if (userAgent.IndexOf("Windows NT 5.2") > 0)
{
//Windows Server 2003; Windows XP x64 Edition
}
else if (userAgent.IndexOf("Windows NT 5.1") > 0)
{
//Windows XP
}
else if (userAgent.IndexOf("Windows NT 5.01") > 0)
{
//Windows 2000, Service Pack 1 (SP1)
}
else if (userAgent.IndexOf("Windows NT 5.0") > 0)
{
//Windows 2000
}
else if (userAgent.IndexOf("Windows NT 4.0") > 0)
{
//Microsoft Windows NT 4.0
}
else if (userAgent.IndexOf("Win 9x 4.90") > 0)
{
//Windows Millennium Edition (Windows Me)
}
else if (userAgent.IndexOf("Windows 98") > 0)
{
//Windows 98
}
else if (userAgent.IndexOf("Windows 95") > 0)
{
//Windows 95
}
else if (userAgent.IndexOf("Windows CE") > 0)
{
//Windows CE
}
else
{
//Others
}