I have created a function in c# which uses the user agent and returns the OS and its architecture. It works fine except for the Firefox 3.6.28 where it shows the 32bit windows XP instead of 64bit XP
user agent-string returned by FF 3.6.28
"Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.28) Gecko/20120306 Firefox/3.6.28 GTB7.1 ( .NET CLR 3.5.30729) "
here is the code
HttpBrowserCapabilities browser = Request.Browser;
string platform = browser.Platform;
Response.Write(platform +"</br>");
if (platform.Contains("Win"))
{
Response.Write("Your OS : Windows </br>");
string str = Request.UserAgent;
if (str.IndexOf("WOW64") != -1 || str.IndexOf("Win64") != -1)
{
Response.Write("This is a 64 bit OS </br></br>");
}
else
{
Response.Write("Not a 64 bit OS");
}
Response.Write(str + "</br></br>");
}
else
{
Response.Write("Your OS :Non Windows </br>");
}