[RESOLVED] How to delete text file!
I have a sequential file and I would like to edit it. I will do this by reading it all into an array, edit it, and write it all back. When I do that, the new edited text writes perfectly... but it doesn't remove the OLD text!!!!
How can I remove ALL the text inside the text file and re write it?
thankyou
Re: How to delete text file!
You seem to be appending instead of overwriting. Check your settings for opening the file in your writing method.
Re: How to delete text file!
hmm I would like to code to delete the ALL the text inside the file and over write it.
exmaple
streamwriter.clear()
or somthing like that
Re: How to delete text file!
Like wossname suggested:
VB Code:
Dim sw As New StreamWriter("<file path here>", False)
The second argument is True to append or False to overwrite.
Re: How to delete text file!
OHHHHH so that what TRUE means!! thanks dude!!!!
Re: [RESOLVED] How to delete text file!
May I recommend never using any function without first fully understanding what the arguments are, mean and do. :)