emptying or deleting a text file

donrecardo

Member
Joined
Sep 24, 2009
Messages
14
Programming Experience
Beginner
Hi ,
we are just learning about stream reader writer.

Suppose I collect names from a text box and append them to a file
( names.txt) during the day. How can I either delete the file or at least empty it so tomorrow I can start with a blank file again

Thanks
Don
 
Deleting a file is easy enough:
VB.NET:
If File.Exists("names.txt") Then
   File.Delete("names.txt")
End If
 
Back
Top