httpbrowsercapabilities

Is there a chance to use App_Browsers to detect support of the HTML5 File API?

好久不见. 提交于 2019-12-22 13:04:42
问题 Using the HTML5 File API to upload files, I am currently using some hardcoded checking of the browsers that support them, depending on the user agent string: internal bool IsHtml5FileUploadCapable { get { var browser = Request.Browser; var n = browser.Browser.ToLowerInvariant(); var major = browser.MajorVersion; var minor = browser.MinorVersion; return n.Contains(@"chrome") && major >= 6 || n.Contains(@"ie") && major >= 10 || n.Contains(@"firefox") && (major >= 3 && minor > 6 || major >= 4) |

Is there a chance to use App_Browsers to detect support of the HTML5 File API?

安稳与你 提交于 2019-12-22 13:04:12
问题 Using the HTML5 File API to upload files, I am currently using some hardcoded checking of the browsers that support them, depending on the user agent string: internal bool IsHtml5FileUploadCapable { get { var browser = Request.Browser; var n = browser.Browser.ToLowerInvariant(); var major = browser.MajorVersion; var minor = browser.MinorVersion; return n.Contains(@"chrome") && major >= 6 || n.Contains(@"ie") && major >= 10 || n.Contains(@"firefox") && (major >= 3 && minor > 6 || major >= 4) |

HttpBrowserCapabilities missing some information?

Deadly 提交于 2019-12-11 09:59:43
问题 I'd like to use the Request.Browser property ( HttpBrowserCapabilities class) to determine some properties of the client's system. However I seem to run into some limitations of this class. I can't find some properties that should be relatively easy to parse from the UserAgent string, like the OS version ( Platform will only return WinNT for most Windows versions, but not Vista, XP, etc.) or whether it's x64 or not (only Win16 and Win32 properties). I would have expected to see these

HttpBrowserCapabilities Custom Browser file parsing

做~自己de王妃 提交于 2019-12-11 06:07:37
问题 If I have a custom .browser file, and I want to evaluate what will happen if it is given a particular User Agent, is there any way to do that through the .NET API? I was attempting to use HttpBrowserCapabilites, but I'm not sure how to load a custom .browser file into that class. 回答1: Normally, you should not have to explicitly load the HttpBrowserCapabilities class; ASP.NET will load it for you, as long as you have your .browser file in the right place (in App_Browsers). However, testing it

Is there a chance to use App_Browsers to detect support of the HTML5 File API?

有些话、适合烂在心里 提交于 2019-12-06 06:29:10
Using the HTML5 File API to upload files, I am currently using some hardcoded checking of the browsers that support them, depending on the user agent string: internal bool IsHtml5FileUploadCapable { get { var browser = Request.Browser; var n = browser.Browser.ToLowerInvariant(); var major = browser.MajorVersion; var minor = browser.MinorVersion; return n.Contains(@"chrome") && major >= 6 || n.Contains(@"ie") && major >= 10 || n.Contains(@"firefox") && (major >= 3 && minor > 6 || major >= 4) || n.Contains(@"opera") && (major >= 11 && minor >= 5 || major >= 12) || n.Contains(@"safari") && major

Can I detect IE Document Mode on the server side using the HttpBrowserCapabilities object

青春壹個敷衍的年華 提交于 2019-12-04 04:59:28
问题 I can find out the browser version and specific capabilities using the HttpBrowserCapabilities object, but is there a way I can find the Document Mode that the browser is using to render? The equivalent of the JavaScript property document.documentMode The mode can be changed via the developer tools Update I was hoping to include a separate stylesheet for IE7 and below using something like this in my razor layout page... @if (ViewContext.IsBrowserOlderThanIE8()) { <link href="Ie7.css" rel=

How to get browser “Document Mode”

自作多情 提交于 2019-11-29 18:23:02
问题 I am developing some kind of JavaScript library. And i cause the problem that i have some specific issues for: Browser : IE8 / IE9 and Document Mode : IE7 I found the solution, but i don't want to use it in all situation, and want to use it just when i have the situation described above. I know that I can recognize browser by using: return navigator.userAgent.toLowerCase().indexOf('MSIE 8') > -1; But i recognize just browser version in such way but not the document mode, and i don't want to

how do I detect user operating system

不羁的心 提交于 2019-11-27 07:07:21
I have the following code to obtain user details: HttpBrowserCapabilities bc = HttpContext.Current.Request.Browser; string UserAgent = HttpContext.Current.Request.UserAgent; ENT_TrackingData ret = new ENT_TrackingData() { IPAddress = HttpContext.Current.Request.UserHostAddress, Browser = bc.Browser + " " + bc.Version, DateStamp = DateTime.Now, PageViewed = HttpContext.Current.Request.Url.AbsolutePath, NodeId = UmbracoHelper.GetCurrentNodeID(), IsMobileDevice = IsMobileDevice(UserAgent), Platform = bc.Platform }; This works great but I noticed that the Platform always says windows NT for my

how do I detect user operating system

柔情痞子 提交于 2019-11-26 13:04:01
问题 I have the following code to obtain user details: HttpBrowserCapabilities bc = HttpContext.Current.Request.Browser; string UserAgent = HttpContext.Current.Request.UserAgent; ENT_TrackingData ret = new ENT_TrackingData() { IPAddress = HttpContext.Current.Request.UserHostAddress, Browser = bc.Browser + \" \" + bc.Version, DateStamp = DateTime.Now, PageViewed = HttpContext.Current.Request.Url.AbsolutePath, NodeId = UmbracoHelper.GetCurrentNodeID(), IsMobileDevice = IsMobileDevice(UserAgent),