ƶļ []  
  

weiyi75 Ϣ 
Ϊ 
weiyi75 ǰ 
ʱ2383 Сʱ 2890  Ǯ2301  133  ¼2011-6-13 עʱ2005-11-7 2619 3 30667 ĶȨ200 UID41299  
ʦ



ʦ,  30667, һ 1333  
޵0  133  2890  עʱ2005-11-7 3 2619  1¥ 
  2007-3-13 09:22 |ֻ | |ӡ 
ϣļϵͳ3

drive,dir,fileؼ
ıһ,ť3

fileؼMultiSelect = 2ѡļ
filenameֻܷһѡļ

Ͷ鷳ˡ

Զ
File1.Selected Խж,Ϊ,͵õFileNameˡ

'

Option Explicit

Private Declare Function MoveFile Lib "kernel32" Alias "MoveFileA" (ByVal lpExistingFileName As String, ByVal lpNewFileName As String) As Long

'ļ·
Private Declare Function SHGetPathFromIDList Lib "shell32.dll" Alias _
                          "SHGetPathFromIDListA" (ByVal pidl As Long, ByVal pszPath As String) As Long

'ʾļб
Private Declare Function SHBrowseForFolder Lib "shell32.dll" Alias "SHBrowseForFolderA" (lpBrowseInfo As BROWSEINFO) As Long

Private Type BROWSEINFO

    hOwner As Long               '
    pidlRoot As Long             'չĿ¼
    pszDisplayName As String
    lpszTitle As String          'б
    ulFlags As Long              '涨ֻѡļУЧ
    lpfn As Long
    lParam As Long
    iImage As Long

End Type

Private Const BIF_RETURNONLYFSDIRS = &H1

Private Sub Command4_Click()

    Dim msgRet&, i&

    If File1.ListCount = 0 Then

        MsgBox "ûռҪƶļ!", 64, "ʾϢ"

    ElseIf Len(Text1.Text) = 0 Then

        MsgBox "ѡļƶ·", 64, "ʾϢ"

    Else

        msgRet& = MsgBox("ȷҪƶռļ?", 33, "ʾϢ")

        If msgRet& = vbOK Then

            If Len(Text1) > 0 Then

                For i& = 0 To File1.ListCount - 1

                    'жѡļSelectedǷΪ
                    If File1.Selected(i&) Then

                        'ע,MoveFileṩ·
                        MoveFile Dir1.path & "\" & File1.List(i&), Text1 & File1.List(i&)

                    End If

                Next

            End If

            File1.Refresh

            MsgBox "ȫļƶ", vbInformation

        End If

    End If

End Sub

Private Sub Dir1_Change()    'ѡļ

    File1.path = Dir1.path
    Label1.Caption = "ѡȡҪƶļ " & File1.ListCount & " "

End Sub

Private Sub Drive1_Change()   'ѡ

    Dir1.path = Drive1.Drive

End Sub

Private Sub Command1_Click()

    Dim bi As BROWSEINFO, r As Long, pidl As Long, path As String, pos As Integer

    bi.hOwner = Me.hwnd                     '
    bi.pidlRoot = 0&                        'չĿ¼
    bi.lpszTitle = "ѡװ·"   'б
    bi.ulFlags = BIF_RETURNONLYFSDIRS       '涨ֻѡļУЧ

    pidl = SHBrowseForFolder(bi)            'APIʾб

    path = Space$(512)

    r = SHGetPathFromIDList(ByVal pidl&, ByVal path) 'APIȡص·

    If r Then

        pos = InStr(path, Chr$(0))          'InStr Variant (Long)ָһַһַȳֵλá
        Text1 = Left$(path, pos - 1) & "\"      'ȥո

    Else

        Text1 = ""

    End If
End Sub

Private Sub Command3_Click()

    End
    
End Sub

 
 
