1、vb打开对话框同时选择多个文件方法一:Private Sub Command1_Click()On Error GoTo userCanceledDim i As IntegerWith CommonDialog1.CancelError = True.Flags = cdlOFNHideReadOnly Or cdlOFNAllowMultiselect Or cdlOFNEXPlorer Or cdlOFNNoDereferenceLinks.Filter = 所有文件(*.*)*.*.ShowOpenGetFileInfo (.FileName)End WithList1.ClearFo
2、r i = 1 To UBound(FileInfo)List1.AddItem FileInfo(i)NextLabel3 = FileInfo(0)userCanceled:End SubPrivate Sub GetFileInfo(Source As String)Dim t As IntegerFileInfo = Split(Source, Chr(0)If UBound(FileInfo) = 0 ThenReDim Preserve FileInfo(1)t = InStrRev(FileInfo(0), )FileInfo(1) = Mid(FileInfo(0), t + 1)FileInfo(0) = Left(FileInfo(0), t)ElseIf Right(FileInfo(0), 1) Then FileInfo(0) = FileInfo(0) & End IfEnd Sub