Argentini.Halide.H3Http.GetBrowserVersion C# (CSharp) Method

GetBrowserVersion() public static method

Return the version of specific browser based on HTTP headers or -1 if the request came from another browser.
public static GetBrowserVersion ( String browserName ) : Double
browserName String
return Double
        public static Double GetBrowserVersion(String browserName)
        {
            // Returns the version of Mozilla Firefox or a -1
            // (indicating the use of another browser).
            Double rv = -1;

            System.Web.HttpBrowserCapabilities browser = HttpContext.Current.Request.Browser;

            if (browser.Browser.ToLower().EndsWith(browserName.ToLower()))
            {
                rv = (Double)(browser.MajorVersion + browser.MinorVersion);
            }

            return rv;
        }