在ASP.NET中怎么把TEXTBOX内容写入文件,文件是HTML格式的

来源:百度知道 编辑:UC知道 时间:2024/05/24 14:55:30
很急啊,着急.
能保存到服务器上啊.保存用哪个函数啊.

public static void Main()
{
string path = @"D:\my.html";//文件路径
System.IO.File.AppendAllText(path, "TEXTBOX内容", Encoding.UTF8);
}

string msg=this.TextBox1.TextToString();
System.IO.StreamWriter sw = new System.IO.StreamWriter("C:\\1.html");
sw.Write(msg);
sw.Close();