SyntaxFix
Write A Post
Hire A Developer
Questions
There are methods like WriteAllText in the File class for common operations on files.
WriteAllText
File
Use the MapPath method to get the physical path for a file in your web application.
MapPath
File.WriteAllText(Server.MapPath("~/data.txt"), TextBox1.Text);