webClient.DownloadString()中的unicode并将html插入文字

时间:2011-04-17 19:34:16

标签: asp.net unicode utf-8

using (WebClient client = new WebClient())
    {
        result = client.DownloadString(TextBox1.Text );
    }

  literal.text=result;

如何将Unicode result; utf-8

2

如果www.google.com在地址栏中输入该页面。写入代码时加载速度相等(结果)

这样怎么能更快。(结果)

3

literal.text=result

sqy错误:Microsoft JScript运行时错误:'document.f.q'为null或不是对象

结果= “.....” 我认为<html></htm><body></body>

的错误

2 个答案:

答案 0 :(得分:1)

    byte[] byteA = new byte[99999];

    using (WebClient client = new WebClient())
    {
        byteA  = client.DownloadData(TextBox1.Text );    
    }

DownloadData resolve utf-8

答案 1 :(得分:0)

这会将result转换为UTF-8:

System.Text.Encoding.UTF8.GetBytes(result)