how to clear content of text file ?

itayzoro

Member
Joined
Jul 28, 2008
Messages
23
Programming Experience
Beginner
HI

I got text file lets say : take1.txt and after i export a database i want to clear the content an rewrite , What i dont wont is to delete the file a write it again
 
To make it a null file you can use a FileStream and SetLenght method, but if you were going to start writing new lines right away the suggested StreamWriter with append option False is better.
 
Back
Top