Results 1 to 3 of 3

Thread: How to validate a file was created *Resolved*

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2001
    Posts
    244

    How to validate a file was created *Resolved*

    My app generates 4 text files in the directory that the application was run from. Is there a way that after it creates the 4 files that it can go out and validate that indeed the files were created and return the status.
    Last edited by jlegan; May 22nd, 2003 at 10:07 AM.

  2. #2
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    If you want to know a file exists in a directory you can check it in this way:
    VB Code:
    1. Dim myfile as New IO.FileInfo("The_Full_Path_of_File_here")
    2. If myfile.Exists Then
    3.    Messagebox.Show("File Exists")
    4. Else
    5.   Messagebox.Show("File Does noit Exist")
    6. End If
    'Heading for the automatic overload'
    Marillion, Brave, The Great Escape, 1994

    'How will WE stand the FIRE TOMORROW?'
    Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979

  3. #3
    Lively Member
    Join Date
    Feb 2003
    Location
    UK
    Posts
    95
    File.Exists is a shared function so you can also do this...

    Code:
    If File.Exists("The_Full_Path_of_File_here") Then
        Messagebox.Show("File Exists")
    Else
        Messagebox.Show("File Does noit Exist")
    End If

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