How can I block all mobile phones from accessing my website

雨燕双飞 提交于 2019-12-01 14:08:33

Your only hope it to check for the User-Agent header property on the HTTP request, and deny content to those User-Agents coming from mobile phones.

Here's a list of user agents for mobile devices: http://www.zytrax.com/tech/web/mobile_ids.html

You'll have to use the HttpResquest.UserAgent property for that: http://msdn.microsoft.com/en-us/library/system.web.httprequest.useragent.aspx

Good luck.

You will likely have to use an IIS module (like URL Rewrite v2) and do something like this: http://forums.iis.net/t/1169853.aspx

Look at the request blocking feature.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!