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.
Printable View
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.
If you want to know a file exists in a directory you can check it in this way:
VB Code:
Dim myfile as New IO.FileInfo("The_Full_Path_of_File_here") If myfile.Exists Then Messagebox.Show("File Exists") Else Messagebox.Show("File Does noit Exist") End If
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