我在页面1中单击一个按纽后得到页面2中的数据放在文本框textbox1中,
页面2中的数据就是几个汉字:测试车

解决方案 »

  1.   

    1、如果页面2是本地文件,用File去读取数据
    2、如果是URL,那用HttpWebRequest去读取数据
      

  2.   

    URL,不能直接传
    http://community.csdn.net/Expert/topic/4931/4931567.xml?temp=.1004907
    看看这里面
      

  3.   

    只要不是中文就正确,可怎么解决乱码的问题呢
    我在页面上也加上了
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <meta http-equiv="content-language" content="gb2312">
    也不行呀
      

  4.   

    查询内容用Server.UrlEncode编码
    string url ="http://localhost/test/test.aspx?a="+ Server.UrlEncode("张三");
     解-->Server.UrlDecode()
      

  5.   

    private string GetHtmlString(string sUrl)
    {
    string sHtml = "";
    HttpWebRequest request;
    HttpWebResponse response=null;
    Stream stream; while (true)
    {
    try
    {
    request =(HttpWebRequest)WebRequest.Create(sUrl);
    response=(HttpWebResponse)request.GetResponse();
    stream=response.GetResponseStream();
    sHtml=new StreamReader(stream,System.Text.Encoding.Default).ReadToEnd();
    break;
    }
    catch (Exception e)
    {
    if (response!=null) response.Close();
    DialogResult result=
    MessageBox.Show(null,"Http request time out. Do you want to retry?","Time Out Error",MessageBoxButtons.YesNo);
    if (result==DialogResult.No)
    throw e; }
    }
    stream.Close();
    response.Close();
    return sHtml;
    }