摘要:
今天在做一个wap网站时,需要限制PC用户访问。网上找了很多资料,效果都不怎么理想。其实原理就是根据HTTP_USER_AGENT判断检查用户在用什么浏览器,再根据业务做相应的逻辑处理。 代码如下: 1 public class IsPhoneAttribute : ActionFilterAttribute 2 { 3 public override void OnActionExecuting(ActionExecutingContext filterContext) 4 { 5 string u = filterConte... 阅读全文
posted @ 2012-11-19 14:21
俗雅冰山
阅读(11743)
评论(8)
推荐(3)

浙公网安备 33010602011771号