Skip to main content

AccessTr.neT


Salt Okunur Dosyaları, Gizli Dosyaları, Sistem Dosyalarını Eklemek

Salt Okunur Dosyaları, Gizli Dosyaları, Sistem Dosyalarını Eklemek

#3
Public Function FileExists(ByVal strFile As String, Optional bFindFolders As Boolean) As Boolean
    Dim lngAttributes As Long

    If bFindFolders Then
        lngAttributes = (lngAttributes Or vbDirectory) 'Include folders as well.
    Else
        'Strip any trailing slash, so Dir does not look inside the folder.
        Do While Right$(strFile, 1) = "\"
            strFile = Left$(strFile, Len(strFile) - 1)
        Loop
    End If

    'If Dir() returns something, the file exists.
    On Error Resume Next
    FileExists = (Len(Dir(strFile, lngAttributes)) > 0)
End Function
@benbendedeilem
Cevapla

Bir hesap oluşturun veya yorum yapmak için giriş yapın

Yorum yapmak için üye olmanız gerekiyor

ya da

Bu Konudaki Yorumlar
RE: Salt Okunur Dosyaları, Gizli Dosyaları, Sistem Dosyalarını Eklemek - Yazar: accessman - 21/05/2020, 10:37
Task