Главная страница  Справочная по Бейсику

Проверка существования файла


Public Function nasFileExists(FilePath As String) As Boolean
On Error Resume Next
Dim feFile
Err.Clear
feFile = FreeFile
FilePath = Replace(FilePath, "\\", "\")
Open FilePath For Input As #feFile
If Err.Number = 53 Or Err.Number = 76 Then
nasFileExists = False
GoTo OK
Else
nasFileExists = True
End If
OK:
Close #feFile
Err.Clear
End Function

Private Sub Form_Load()
If nasFileExists("C:\autoexec.bat") Then
MsgBox "Файл существует!", vbInformation
Else
MsgBox "Файл не найден...", vbInformation
End If
End Sub




Для Поисковиков:
Исходники на Бейсике;
Программа на Бейсике;
Файл;
Существование файла;
Как проверить существует ли файл?;
Хостинг от uCoz