Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
 
 
 
500MB 27GB Web Hosting - $9.95/Month
 
 
 
 
 
Old Pages
 
Old Index
Site Map
What's New
 
Books
How To
Tips & Tricks
Tutorials
Stories
Performance
Essays
Links
Q & A
New in VB6
Free Stuff
Pictures
 
 
 
TitleSee if a file exists and get the time it was last modified
Keywordsfile, exists, time, modified
CategoriesFiles & Directories
 
Use GetAttr to see if the file exists. Use FileDateTime to get the time it was created or last modified.

Thanks to Phil McCarthy

 
Private Sub Command1_Click()
     b$ = Text1.Text

     On Error GoTo filenotfound
     a$ = GetAttr(b$)

     Label1.Caption = "file exists"
     Exit Sub

filenotfound:
     Label1.Caption = "file does not exist"
End Sub

Private Sub Command2_Click()
     b$ = Text1.Text

     On Error GoTo filenotfound
     a$ = FileDateTime(b$)

     Label1.Caption = a$
     Exit Sub

filenotfound:
     Label1.Caption = " Not a valid path or file"
End Sub

Private Sub Form_Load()
    file_name = App.Path
    If Right$(file_name, 1) <> "\" Then file_name = _
        file_name & "\"
    file_name = file_name & "FileTim4.frm"
    Text1.Text = file_name
End Sub
 
Formatted by Neil Crosby
 
 
Copyright © 1997-2003 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated