HtmlContent="<html><head></head><body>"+FreeTextBox1.HtmlEncodedText+"</body></html>";
using (FileStream fs = File.Create(FilePath+TextBox1.Text))
{

StreamWriter sf=new StreamWriter(fs,System.Text.Encoding.GetEncoding("GB2312"));
sf.WriteLine(HtmlContent);


sf.Close();
fs.Close();
}
uContent.Attributes["src"] =FilePath+TextBox1.Text;
    Label1.Text="添加成工";
Label3.Text=FreeTextBox1.HtmlEncodedText;得到的html文件  <>  显示不出来

解决方案 »

  1.   

    &lt;P&gt;现在华为科技有限公司全力开拓海外市场,华为慧通公司作为华为的全资子公司,招聘C/C++软件开发人才。(待遇与华为公司相同,与华为公司的员工在一起上班)&lt;BR&gt;主要从事UNIX或者WINDOWNS平台上的大型电信软件开发,工作地点在深圳华为基地!&lt;BR&gt;招聘基本要求:&lt;BR&gt;熟悉C/C++编程技术;&lt;BR&gt;熟悉SQL Server/Oracle等数据库;&lt;BR&gt;有一年以上UNIX/WINDOWS平台上的软件开发经验。&lt;/P&gt;
    &lt;P&gt;如果哪位兄弟有意,请发送简历到 &lt;A href=&quot;mailto:[email protected]&quot;&gt;[email protected]&lt;/A&gt;&lt;/P&gt;
    &lt;P&gt;&amp;nbsp;&lt;/P&gt;
    &lt;P&gt;&amp;nbsp;&lt;/P&gt;
    &lt;P&gt;&lt;A 写入的文本显示的是上面的
      

  2.   

    需要替换用这两个函数
    具体的自己还可以修改一下/// <summary>
    /// ×&Ouml;·&ucirc;&Acirc;&euml;×&ordf;&raquo;&raquo;&Icirc;&ordf;HTML&Acirc;&euml;
    /// </summary>
    /// <param name="str">string</param>
    /// <returns></returns>
    public static string Encode(string str)
    {
    str = str.Replace("&","&amp;");
    str = str.Replace("'","''");
    str = str.Replace("\"","&quot;");
    str = str.Replace(" ","&nbsp;");
    str = str.Replace("<","&lt;");
    str = str.Replace(">","&gt;");
    str = str.Replace("\n","<br>");
    return str;
    }/// <summary>
    /// HTML&Acirc;&euml;×&ordf;&raquo;&raquo;&Icirc;&ordf;×&Ouml;·&ucirc;&Acirc;&euml;
    /// </summary>
    /// <param name="str">string</param>
    /// <returns></returns>
    public static string Decode(string str)
    {
    str = str.Replace("<br>","\n");
    str = str.Replace("&gt;",">");
    str = str.Replace("&lt;","<");
    str = str.Replace("&nbsp;"," ");
    str = str.Replace("&quot;","\"");
    return str;
    }
      

  3.   

    我想是 编码问题  现在用的是 UTF-8 编码
    你没有看懂  我的问题  
    还是谢谢了