using System.Text;
using System.IO;
2. And write This code...........
protected void Button1_Click(object sender, System.EventArgs e)
{
string appPath = Request.PhysicalApplicationPath;
string filePath = appPath + "Text.txt";
StreamWriter w;
w = File.CreateText(filePath);
w.WriteLine("This is a test line.");
w.WriteLine("This is another line.");
w.Flush();
w.Close();
Label1.Text = "File created and write successfully!";
Label1.Text += filePath;
}
No comments:
Post a Comment