Tag: user agent

Request.UserAgent和Request.Browser有什么区别?

这是我的代码如下: User_Info.Add(!string.IsNullOrEmpty(Request.UserAgent) ? Request.UserAgent : string.Empty);//4:UserAgent HttpBrowserCapabilities browser = Request.Browser; User_Info.Add(!string.IsNullOrEmpty(browser.Browser) ? “Name : ” + browser.Browser + ” | ” + “Type : ” + browser.Type + ” | ” + “MajorVersion : ” + browser.MajorVersion + ” | ” + “MinorVersion : ” + browser.MinorVersion : string.Empty);//5:UserBrowser Request.UserAgent和Request.Browser有什么区别? 我无法理解那些UserAgent字符串! 请你举一些解释的例子吗?

用户代理导致MVC DisplayFor ArgumentException:路径中的非法字符

我遇到一个问题,即移动设备上的用户遇到MVC中的错误,而这在常规桌面上查看网站时不会发生。 我可以通过使用Chrome的开发人员工具并应用除默认值之外的任何其他UA来始终如一地重现错误。 抛出的基础exception是: ArgumentException: Illegal characters in path. at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional) at System.IO.Path.GetExtension(String path) at System.Web.WebPages.DefaultDisplayMode.TransformPath(String virtualPath, String suffix) at System.Web.WebPages.DefaultDisplayMode.GetDisplayInfo(HttpContextBase httpContext, String virtualPath, Func’2 virtualPathExists) at System.Web.WebPages.DisplayModeProvider.GetDisplayInfoForVirtualPath(String virtualPath, HttpContextBase httpContext, Func’2 virtualPathExists, IDisplayMode currentDisplayMode, Boolean requireConsistentDisplayMode) at System.Web.Mvc.VirtualPathProviderViewEngine.GetPathFromGeneralName(ControllerContext controllerContext, List’1 locations, String name, String controllerName, String areaName, String cacheKey, String[]& searchedLocations) at […]