簡體   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