Configure web.config to access website only using IE
You can use the HTTP_USER_AGENT header to see what's the browser that's submitting the request. For I.E it would be like :
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; InfoPath.2; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E)
P.S: This header can be manipulated by the client and submitted to browser so it is not 100% reliable. Am curious to know why you want to restrict users to I.E?
There is no direct support for this functionality. However, you could validate the browser in an implementation of IHttpHandler
and register that in web.config.
精彩评论