繁体   English   中英

将编辑的html文件保存到特定文件夹

[英]Save editing html file to specific folder

我建立了一个项目,用户可以上载,查看,编辑并将其文件保存在特定的文件夹中。 我使用TinyMCE进行编辑,但是在编辑后找不到如何保存内容的方法。 有人可以给我一些建议吗?

这是保存TinyMCE控件值的方法。

String OutPath = Server.MapPath("~/myfiles/test.txt");  // here '~/' refers to root of your website

            StreamWriter Out1 = new StreamWriter(OutPath);
            Out1.WriteLine(TextBox1.Text.Trim());
            Out1.Close(); //Close File

假设您需要将html保存在根文件夹内的HtmlFiles文件夹中,文件名为test.html

string path = Server.MapPath("~/HtmlFiles/test.html");
File.WriteAllText(path ,yorTextBox.Text);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM