我现在有一文本框,里面输入内容后,点击button是一个保存形式,然后把这文本框里的内容保存成html形式asp.net不是很会,希望高手写个简单的例子!!理解好像是先用create创建下,然后fileSteam只会简单想下!实力还是不会,希望大家帮下忙!!谢谢了!

解决方案 »

  1.   

    直接用
    用FreeTextBox编辑器就应该可以,在页面的时候用System.Web.HttpUtility.HtmlDecode(字段)方法转换一下就行了!
      

  2.   

    System.Web.HttpUtility.HtmlEncode(string   s);
      

  3.   

    把你要保存的写成HTML形式就可以了
      

  4.   


          try
            {
                using (StreamWriter sw = new StreamWriter(dirPath + filename, false, Encoding.UTF8)) //保存地址 filename文件名 如 a.html dirPath路径 如 D://a//a
                {
                    sw.WriteLine(indexlist); //indexlist 内容
                    sw.Flush();
                    sw.Close();            }
            }
            catch (Exception ex)
            {
                Response.Write("The file could not be wirte:");
            }