争怎路由网/网站教程/内容

“打开”对话框一起选择多个文件

网站教程2024-07-13 阅读
Private Sub Command1_Click()
    On Error GoTo userCanceled
    Dim i As Integer
    With CommonDialog1
        .CancelError = True
        .Flags = cdlOFNHideReadOnly Or cdlOFNAllowMultiselect Or cdlOFNExplorer Or cdlOFNNoDereferenceLinks
        .Filter = "所有文件(*.*)(专业提供视频软件下载)

*.*"
        .ShowOpen
        GetFileInfo (.FileName)
    End With
    List1.Clear
    For i = 1 To UBound(FileInfo)
        List1.AddItem FileInfo(i)
    Next
    Label3 = FileInfo(0)
userCanceled:
End Sub
Private Sub GetFileInfo(Source As String)
    Dim t As Integer
    FileInfo = Split(Source, Chr(0))
    If UBound(FileInfo) = 0 Then
        ReDim Preserve FileInfo(1)
        t = InStrRev(FileInfo(0), "\")
        FileInfo(1) = Mid(FileInfo(0), t + 1)
        FileInfo(0) = Left(FileInfo(0), t)
    Else
        If Right(FileInfo(0), 1) <> "\" Then FileInfo(0) = FileInfo(0) & "\"
    End If
End Sub

……

相关阅读