revised!
I want to create a file say called test.txt.
if that file already exists I want to create file called test1.txt and so on.
revised!
I want to create a file say called test.txt.
if that file already exists I want to create file called test1.txt and so on.
The classes in System.IO should help you do that.
Pass in
FileMode.Create
toFile.Open(string, FileMode)
when opening the file and it will create a new file every time.Here is a short example: