语言类型记得改成gb2312
Chr(13) & Chr(10) 改成\r\n即可

解决方案 »

  1.   

    vs.net的advanced save options选择语言
      

  2.   

    Chr(13) & Chr(10) 改成\r\n即可
    这样是不行的,我试了。直接输出\r\n,我用的是vb.net 啊。
      

  3.   

    加上这句
    str &= <META http-equiv=""Content-Type"" content=""text/html; charset=gb2312"">
      

  4.   

    qimini(循序渐进) 
    没用啊,这个我加过
      

  5.   

    你在输出任何流时请转换成UTF-8。
    你服务器端Response的是GB2312格式,而IE6.0浏览器默认的设置是UTF-8发送、UTF-8接受
    所以在向浏览器发送任何形式的字符时,要先用UTF-8编码A Sample:String fileName=System.Web.HttpUtility.UrlEncode( System.Text.Encoding.UTF8.GetBytes("现金日报表"));
      

  6.   

    str = System.Web.HttpUtility.UrlEncode(System.Text.Encoding.UTF8.GetBytes(str))我加了这一句后,输出的是:(源代码也这样,不象原来,源代码里是不乱码的。)
    %3c!DOCTYPE+HTML+PUBLIC+%22-%2f%2fW3C%2f%2fDTD+HTML+4.0+Transitional%2f%2fEN%22%3e%0d%0a%3chtml%3e%0d%0a%3chead%3e%0d%0a%3ctitle%3e%e9%a6%96%e9%a1%b5%e5%85%ac%e5%91%8a%3c%2ftitle%3e%0d%0a%3cmeta+name%3d%22vs_defaultClientScript%22+content%3d%22JavaScript%22%3e%0d%0a%3cmeta+name%3d%22vs_targetSchema%22+content%3d%22http%3a%2f%2fschemas.microsoft.com%2fintellisense%2fie5%22%3e%0d%0a%3cmeta+name%3d%22GENERATOR%22+content%3d%22Microsoft+Visual+Studio+.NET+7.1%22%3e%0d%0a%3cmeta+name%3d%22ProgId%22+content%3d%22VisualStudio.HTML%22%3e%0d%0a%3cmeta+name%3d%22Originator%22+content%3d%22Microsoft+Visual+Studio+.NET+7.1%22%3e%0d%0a%3c%2fhead%3e%0d%0a%3cbody+bottomMargin%3d0+bgColor%3d%23b50000+leftMargin%3d0+topMargin%3d0+rightMargin%3d0%3e%0d%0a%e6%b3%a8%ef%bc%9a%e6%82%a8%e5%8f%af%e4%bb%a5%e5%9c%a8%e6%ad%a4%e8%be%93%e5%85%a5%e5%86%85%e5%ae%b9%ef%bc%8c%e7%94%b1%e7%b3%bb%e7%bb%9f%e7%94%9f%e6%88%90%ef%bc%8c%e4%b9%9f%e5%8f%af%e4%bb%a5%e8%87%aa%e5%b7%b1%e6%9b%b4%e6%94%b9gonggao.htm%e8%bf%99%e4%b8%aa%e9%a1%b5%e9%9d%a2%0d%0a%3c%2fbody%3e%0d%0a%3c%2fhtml%3e%0d%0a
      

  7.   

    我的代码是向其他页面传GET参数时用的,你不能抄的 :)你应该这样做 
    using System.Text;......dim x as char()=str.ToCharArray()'VB语法忘了,把str转到char数组
    str=Encoding.UTF8.GetString(x);
    objwrite = File.CreateText(MapPath("../gonggao.htm"))
    objwrite.WriteLine(Str)
    objwrite.Close()
      

  8.   

    BTW,你不得不为不同区域设置的浏览器分别编写代码~~~
      

  9.   

    查了大量资料后终于搞定了。感谢大家的帮助。
            Dim filename = MapPath("../gonggao.htm")
            Dim SwFromFileTrueUTF8 = New StreamWriter(filename, False, System.Text.Encoding.UTF8)
            SwFromFileTrueUTF8.Write(str)
            SwFromFileTrueUTF8.Flush()
            SwFromFileTrueUTF8.Close()