急急急!vb中如何实现将一个文件拷贝到U盘的一个目录里!但是我不确定U盘的盘符!怎么办??

来源:百度知道 编辑:UC知道 时间:2024/06/06 07:53:28
能否出现选择目录界面??越详细越好!

选择目录界面:
Set sh = CreateObject("Shell.application")
Set fd = sh.BrowseForFolder(Me.hWnd, "选择文件夹", 0)
If Not fd Is Nothing Then
MsgBox "您选中的文件夹是:" & fd.Self.Path
End If

获取我的电脑中U盘盘符

dim fs, dc, d
Set fs=CreateObject("Scripting.FilesystemObject")
Set dc=fs.Drives
For Each d in dc
If d.DriveType=1 then
Msgbox d.DriveLetter & "盘是个可移动磁盘"
End If
Next

copyFile API