Cautare fisier
Last Updated: Jan 06 2006 23:27, Started by
Razvan88
, Jan 02 2006 22:18
·
0
#1
Posted 02 January 2006 - 22:18
Cum pot verifica daca un fisier exista intr-un director cunoscut ? De ex: Fishierul a.exe vreau sa il caut in "C:\Windows" .
|
#2
Posted 04 January 2006 - 10:51
Private Sub Form_Load() If FileExists("C:\Windows\a.exe") Then MsgBox "file found" Else MsgBox "file not found" End If End Sub Private Function FileExists(fullpath As String) As Boolean 'cand fisierul nu exista vb sare cu erroare;) On Error GoTo ff If GetAttr(fullpath) Then FileExists = True ' file exists Else ff: FileExists = False 'file not found End If End Function Mai poti face cu API (FindFirstFile): wfd as WIN32_FIND_DATA hFind as long hFind = FindFirstFile(fullpath, wfd) if hFind == -1) FileExists =false else FindClose hFind FileExists =true end if bafta! |
Anunturi
Bun venit pe Forumul Softpedia!
▶ 0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users