Feb 20, 2004 #1 L lilgirl Member Joined Jun 21, 2003 Messages 24 Hi, I have the following code: Code: Dim htmlfile As System.IO.StreamWriter = New System.IO.StreamWriter(newstr) What I want to do is: if newstr exists, overwrite its contents. how can i implement this as the above code does not do this. thanks.
Hi, I have the following code: Code: Dim htmlfile As System.IO.StreamWriter = New System.IO.StreamWriter(newstr) What I want to do is: if newstr exists, overwrite its contents. how can i implement this as the above code does not do this. thanks.
Feb 21, 2004 #2 dynamic_sysop Well-known member Joined Oct 1, 2002 Messages 1,039 Location Ashby, Leicestershire. add , False after the file name to prevent Appending Code: Dim sWriter As New IO.StreamWriter("C:\test.txt", False) sWriter.WriteLine("test") sWriter.Close()
add , False after the file name to prevent Appending Code: Dim sWriter As New IO.StreamWriter("C:\test.txt", False) sWriter.WriteLine("test") sWriter.Close()