none
hide the files in the programm path

    問題

  • hi

    i write a programm with visual basic 6.0 that is hidden folder at programm path(app.path)

    now i want know that i can hide the  files inprogramm path without be at folder .

    tanks a lot


    Dim fso As New FileSystemObject
    
    Public Sub allfilelock(path As String)
    Dim f As Folder, fc As Folders, f1 As Folder
    Dim fil As Files
    Set f = fso.GetFolder(path)
    Set fc = f.SubFolders
    If fc.Count = 0 Then
    Exit Sub
    End If
    For Each f1 In fc
        Set fil = f1.Files
        If fil.Count <> 0 Then
        SetAttr f1.path, vbHidden + vbReadOnly + vbSystem
        
        End If
    
    allfilelock (f1.path)
    Next
    End Sub
    
    Public Sub allfileshow(path As String)
    Dim f As Folder, fc As Folders, f1 As Folder
    Dim fil As Files
    Set f = fso.GetFolder(path)
    Set fc = f.SubFolders
    If fc.Count = 0 Then
    Exit Sub
    End If
    For Each f1 In fc
        Set fil = f1.Files
        If fil.Count <> 0 Then
       SetAttr f1.path, vbArchive
        End If
    
    allfilelock (f1.path)
    Next
    End Sub
    
    Private Sub LHCommand1_Click()
    allfilelock App.path
    End Sub
    
    Private Sub LHCommand2_Click()
    allfileshow (App.path)
    End Sub
    


    • 已移動 Reed KimbleMVP 2011年7月2日 下午 06:07 vb6 (From:Visual Basic Language)
    2011年7月2日 下午 03:39

所有回覆