Here is a command to append to a text file.
1 | Using sw As System.IO.StreamWriter = System.IO.File.AppendText(CSVFileName) |
You need to initialize the CSVFileName variable with a filename, and the Message variable with what you want to put into that file.
DatasetToText
Here is an example of some code to export a dataset to an ascii file on the client PC
1 | Private Sub ExportToText(ByVal ds As DataSet, ByVal response As HttpResponse) |
Reading an ascii file
Here is an example of reading an ascii file
1 | Dim sr As System.IO.StreamReader |
Note: In ASP.Net the filename is respective to where that particular code is being executed from. For example c:\test.txt - might cause this program to check the server’s root. Later versions of IIS will restrict where this code can access.