1,首先写Cookie, Response.Cookies["word"].Value = "我的电脑";
2,然后, 让页面中的一个 TextBox1.Text=Request["word"].ToString();
3,这时TextBox1在页面中显示的值就是“鎴戠殑鐢佃剳” ;我对 “鎴戠殑鐢佃剳”进行过编码转换 ,从所有的编码格式 转换到 gb2312 。
都没转成"我的电脑"。
我的页面Web.Config 
....
<globalization requestEncoding="gb2312" responseEncoding="gb2312" />
....
我试过把他改成UTF-8 也不行
请问怎么才能让页面正确显示"我的电脑"啊????
请高手帮忙啊!
冰天雪地裸体空翻720度脸着地跪求!

解决方案 »

  1.   

    urlEncode之后再存
    取后再urlDecode
      

  2.   

    Response.Cookies["word"] 和Request["word"] 不是一个东西吧Request["word"] 接受的是url的参数
      
    *****************************************************************************
    欢迎使用CSDN论坛专用阅读器 : CSDN Reader(附全部源代码) 最新版本:20070212http://www.cnblogs.com/feiyun0112/archive/2006/09/20/509783.html
      

  3.   

    楼上的有道理Request["word"].ToString();这个接收的是url的参数,以及页面html控件的值lz所接收的Request["word"].ToString();是从哪里来的呢?
      

  4.   

    "Response.Cookies["word"] 和Request["word"] 不是一个东西吧" .......
    一颗星星 怎么弄来的啊。。
      

  5.   

    Response.Cookies["word"].Value = Server.UrlEncode("我的电脑");
    this.Label1.Text = Server.UrlDecode(Request.Cookies["word"].Value);
    测试取值正确!
      

  6.   

    是不是你的CS文件是utf-8格式的?========================================
     传音石——网罗天下资源 http://www.massany.com
    ========================================
      

  7.   

    Response.Cookies["word"].Value = Server.UrlEncode("我的电脑");
    this.Label1.Text = Server.UrlDecode(Request["word"].ToString());
    也可以!测试正确!
      

  8.   

    楼上说Response.Cookies["word"] 和Request["word"] 不是一个东西是很正确的吧!
    cookies乱码可用UrlEncode\UrlDecode解决
      

  9.   

    楼上说Response.Cookies["word"] 和Request["word"] 不是一个东西是很正确的吧!
    支持!
      

  10.   

    Request["word"]这个集合包含了Get字符串、Form子控件、Cookies集合
    虽然用Request["word"]取值不精确,但不是LZ问题的关键
    还是那个观点,进行Url编码再存取