Breaking News
Loading...
Sunday 14 October 2012

How to get name of Platform or operating system of client machine using asp.net ?

Below code is give the name of platform (Operating System) which is use by client.

//////////////////////////////////////// CODE ////////////////////////////////////////


    protected void GetPlatform()
    {

        HttpBrowserCapabilities bc = HttpContext.Current.Request.Browser;
        String Platform = bc.Platform;
        String pt = "";

        if (Request.UserAgent.IndexOf("Windows NT 5.1") > 0)
        {
            //xp
             pt = "win XPath";
        }
        else if (Request.UserAgent.IndexOf("Windows NT 6.0") > 0)
        {
            //VISTA
             pt = "win vista";
        }
        else if (Request.UserAgent.IndexOf("Windows NT 6.1") > 0)
        {
            //7
             pt = "win 7";
        }



////////////////////////////////////////////////////////////////////////////////////////

now you can print the string pt which print the name of browser.


--
/\/ir@\/  <(.'.)>

0 comments:

Post a Comment

Thanks for comment

 
Toggle Footer