Hi,
I have an Open file dialog, My aim is to open a file if it exists else to create a new file with the name which i have provided...How can I?
Thanks
Printable View
Hi,
I have an Open file dialog, My aim is to open a file if it exists else to create a new file with the name which i have provided...How can I?
Thanks
VB Code:
[color=blue]If[/color] IO.File.Exists("path of your file") [color=blue]Then[/color] [color=green]'/// the file exists so carry on with the OpenFileDialog.[/color] [color=blue]Else[/color] [color=green]'/// the file does NOT exist.[/color] IO.File.Create("the file to create") [color=green]'/// or create the file using streamwriter / or savefiledialog etc...[/color] [color=blue]End If[/color]