asp.net 如何判断用户终端

  string sUserAgent = Request.UserAgent.ToLower();
        bool bIsIpad = Regex.IsMatch(sUserAgent, "ipad");
        bool bIsIphoneOs = Regex.IsMatch(sUserAgent, "iphone");
        bool bIsAndroid = Regex.IsMatch(sUserAgent, "android");
        bool bIsWP = Regex.IsMatch(sUserAgent, "windows phone");

如果需要模拟终端,可以在firefox中下载 附加组件

posted @ 2013-03-14 10:13  Peter_youny  阅读(273)  评论(0编辑  收藏  举报