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 asp.net, in filestream, in streamwriter, in Tips & Tricks, in write to text file

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 →

Using ASP.NET to Read from a Text File Using FileStream StreamReader class

Posted on 8/30/10 8:52 AM by Get Schooled in asp.net, in filestream, in Microsoft, in New Horizons Computer Learning Center, in streamreader, in Tips & Tricks

Read from a text file using the FileStream StreamReader class (ASP.NET)
If you're writing to text files in .NET, chances are there will come a time when you want to read from those text files as well. To accomplish this task, you'll need to use the StreamReader class. The StreamReader 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 reads one line from a text file:

0 CommentsContinue Reading →

Search by Topic

    Lists by Topic

    see 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.

     

    Subscribe