谢谢!

解决方案 »

  1.   

    string  Address=Request.UserHostAddress
      

  2.   

    http://topic.csdn.net/t/20030206/16/1406864.html
      

  3.   

    window.document.all.item("Text1").value=screen.width;   
      window.document.all.item("Text2").value=screen.height;   
    这个我不知道放哪里?
      

  4.   

    ip地址
    string  Address=Request.UserHostAddress;分辨率只能在客户端用js获取. 你可以用viewstate,url传递,ajax等把值返回给服务器端进行处理
    <script type="text/javascript">
     alert(screen.width); 
     alert(screen.height); 
    </script>
      

  5.   

    1、首先在页面上建两个html控件:   
      <INPUT   id="Text1"   style="BORDER-RIGHT:   #9999cc   thin   solid;   BORDER-TOP:   #9999cc   thin   solid;   Z-INDEX:   121;   LEFT:   376px;   BORDER-LEFT:   #9999cc   thin   solid;   WIDTH:   82px;   BORDER-BOTTOM:   #9999cc   thin   solid;   POSITION:   absolute;   TOP:   14px;   HEIGHT:   21px"   type="text"   size="8"   value="1"   name="Text1"   runat="server">   
      <INPUT   id="Text2"   style="BORDER-RIGHT:   #9999cc   thin   solid;   BORDER-TOP:   #9999cc   thin   solid;   Z-INDEX:   121;   LEFT:   376px;   BORDER-LEFT:   #9999cc   thin   solid;   WIDTH:   82px;   BORDER-BOTTOM:   #9999cc   thin   solid;   POSITION:   absolute;   TOP:   14px;   HEIGHT:   21px"   type="text"   size="8"   value="1"   name="Text2"   runat="server">   
        
      其中,runat="server"是在设计器中右击选作为服务器控件运行。用来存放分辩率。   
      2、在客户端脚本中:   
      window.document.all.item("Text1").value=screen.width;   
      window.document.all.item("Text2").value=screen.height;   
      这样,分辨率就存放在控件中了。   
      注意:此脚本应放在aspx代码的底部,即</body>上端,否则在页面初始加载时因这两个控件还未生成,会报错。   
      3、在服务器端代码需要用到的地方:   
      string   pagewidth=Request.Form["Text1"].ToString();   
      string   pageheight=Request.Form['Text2"].ToString();   
    以上是COPY的,请问:
    string   pagewidth=Request.Form["Text1"].ToString();   
      string   pageheight=Request.Form['Text2"].ToString();   
    是不是这样的:
    <script type="text/javascript">
    {
    string   pagewidth=Request.Form["Text1"].ToString();   
      string   pageheight=Request.Form['Text2"].ToString();   
    }
    </script>
    我是这样,允许错误:
    未将对象引用设置到对象的实例。 
    说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.NullReferenceException: 未将对象引用设置到对象的实例。
      

  6.   

    <script type="text/javascript">
    {
    string   pagewidth=Request.Form["Text1"].ToString();   
      string   pageheight=Request.Form['Text2"].ToString();   
    }
    </script>
    这个有错吗?
      

  7.   

    ....这个是javascript作用块.string   pagewidth=Request.Form["Text1"].ToString();  是c#的语法.  不同的概念的东西强烈建议你熟悉一下b/s的流程和大概的思路