Results 1 to 2 of 2

Thread: Urgent

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2002
    Posts
    174

    Urgent

    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

  2. #2
    Frenzied Member dynamic_sysop's Avatar
    Join Date
    Jun 2003
    Location
    Ashby, Leicestershire.
    Posts
    1,142
    VB Code:
    1. [color=blue]If[/color] IO.File.Exists("path of your file") [color=blue]Then[/color]
    2.             [color=green]'/// the file exists so carry on with the OpenFileDialog.[/color]
    3.         [color=blue]Else[/color]
    4.             [color=green]'/// the file does NOT exist.[/color]
    5.             IO.File.Create("the file to create")
    6.             [color=green]'/// or create the file using streamwriter / or savefiledialog etc...[/color]
    7.         [color=blue]End If[/color]
    ~
    if a post is resolved, please mark it as [Resolved]
    protected string get_Signature(){return Censored;}
    [vbcode][php] please use code tags when posting any code [/php][/vbcode]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width