Reading and Writing textfile


/ Published in: VB.NET
Save to your folder(s)

Simple function to read and write file from vb.net


Copy this code and paste it in your HTML
  1. Dim sr As New StreamReader("c:\TESINPUT.TXT")
  2. Dim ws As New StreamWriter("c:\TESTOUTPUT.TXT", False)
  3.  
  4. Do While sr.Peek <> -1
  5. ws.WriteLine(sr.ReadLine())
  6. Loop
  7.  
  8. sr.Close()
  9. ws.Close()

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.