Dhondtie

How can I create a new .txt file on a pc

I would have an answer in that style:

If c:\example\example.txt exist then

Else
create c:\example\example.txt
End If

Anyone who know die answer



Re: Visual Basic Express Edition textfile

spotty

How about the following. It will either create a new file or append text to an existing file.

If My.Computer.FileSystem.FileExists("C:\test.txt") = False Then

My.Computer.FileSystem.WriteAllText("C:\test.txt", "Create New file", False)

Else

My.Computer.FileSystem.WriteAllText("C:\test.txt", "Append to existing file", True)

End If