如何将Lable中的内容保存到HTML文件中?急
请问大家: 如何将Lable中的内容保存到HTML文件中,并把文件保存到客户端啊???我保存的都是乱码啊!!!在此小弟谢谢大家了。下面是我写的代码
string fileName = FileName+".html";
StringWriter sw = new StringWriter();
sw.WriteLine(HtmlEditor1.Text);
this.Response.Clear();
this.Response.Buffer = true;
this.Response.Filter.Close();
this.Response.ContentEncoding = System.Text.Encoding.UTF8;
this.Response.Charset = "Unicode";
this.Response.AddFileDependency(fileName);
this.Response.ContentType = "text/csv";
this.Response.AppendHeader("Content-Disposition", "attachment;filename=" + fileName);
this.Response.Write(sw);
this.Response.End();
sw.Close();