高手们请给我点思路,感谢!

解决方案 »

  1.   

    谢谢支持。但手机号没有接口是获取不到的。浏览器的话,电脑与手机都有Opera,也不能完全判断
      

  2.   

    不懂
    电脑访问应该有个IP吧,获取一下 ip 如果匹配一般ip的格式就不让进.
    乱说的.....没接触过wap
      

  3.   

    可能不行吧,SUN的WEB权限给的很低。
      

  4.   

    一般是通过userAgent,不过就像楼主说的,好像对Opera无效
    public static bool GetClientWeb()
        {
            bool result = false;
            string clientType = string.Concat(HttpContext.Current.Request.UserAgent);
            if (clientType.ToLower().Contains("mozilla")  clientType.ToLower().Contains("opera"))
            {
                result = true;
            }
            return result;
        }还有个方法,我没用过,提供给楼主,就是判断客户端的屏幕大小,总不会有手机和电脑屏幕一样大吧,
    <iframe id='getSN'></iframe>
    <script>
    //不知道js能不能获取手机屏幕的大小??
    document.getElementById("getSN").src='test.asp?h='+window.screen.height;
    </script>
    if height<640 then
      response.write "手机"
    else 
      rsponse.write "电脑"