New Horizons Get Schooled Blog

Write to a text file using the FileStream StreamWriter class (ASP.NET)

Posted on 10/10/11 1:38 PM by Get Schooled in, in filestream, in streamwriter, in write to text file, in Tips & Tricks

Even though databases are probably the most popular method for storing data, there are still many applications that rely on basic text files for logging and error tracking. So, if you're writing to text files in .NET, then you need to get to know the StreamWriter class. The StreamWriter class is a member of the FileStream class, which provides all the functionality you need to read and write data to text files. The following code creates a text file and writes two lines to it:

0 CommentsContinue Reading →

Search by Topic

    Lists by Topic

    see all

    Be at the center of it all.


    Knowledge Ninjas

    a web-based service that allows software application end users to access a subject matter expert in real-time via a chat interface to resolve questions or problems they encounter in their specific software.