I think my qusetion is very easy but I don't know how to do it... How can I know if a file exist?
I'm not like them but I can pretend
Use the Dir function. You can get info on using it at msdn.microsoft.com/library/default.asp Look at the toc and goto Microsoft Visual Studio-->Visual Basic-->Reference-->Language Reference-->Functions-->D-->Dir
Oetje [email protected] 93606776 Visual Basic 6, Windows 2000 Never pet a burning dog
Code: If Dir$("MyFile") Then 'File exist Else 'File does not exist End If
If Dir$("MyFile") Then 'File exist Else 'File does not exist End If
I always use the Filelen(pathname) function. This determines the size of the file in bytes. For example: If Filelen("C:\Windows\Win.exe) > 0 then 'file exists Else 'file doesn't exist (figures) End if Hope this helps! Dave.
Thanks to all of you you're quick. It almost faster than the MSDN. And I didn't want to search into that.
Forum Rules