如果你对系统很熟,可以通过COM技术获得和资源管理器一样的界面,国外的站点上有很多关于这种的例子,找找吧。

解决方案 »

  1.   

    Option Explicit'    Purpose:
    '     Author:吴文智
    '       Date:2001-1
    'Description:要试用本例请在窗体中填加一个按钮
    '            然后在代码窗体中粘贴如下代码
    '            Good luck!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 TypeConst BIF_RETURNONLYFSDIRS = &H1
    'Private pidl 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 LongFunction GetPath() As String
      Dim bi As BROWSEINFO
      Dim lngResult As Long
      Dim pidl As Long
      Dim Path As String
      Dim pos As Integer
      Dim strPath As String
      
      '句柄
      bi.hOwner = Me.hWnd
      '展开根目录
      bi.pidlRoot = 0&
     '列表框标题
      bi.lpszTitle = "请选择文档导出的路径:"
     '规定只能选择文件夹,其他无效
      bi.ulFlags = BIF_RETURNONLYFSDIRS
     '调用API函数显示列表框
      pidl = SHBrowseForFolder(bi)
     '利用API函数获取返回的路径
      Path = Space$(512)
      lngResult = SHGetPathFromIDList(ByVal pidl&, ByVal Path)
      If lngResult Then
        pos = InStr(Path, Chr$(0))
        strPath = Left(Path, pos - 1)
        If Right(strPath, 1) <> "\" Then strPath = strPath + "\"
      Else
        strPath = ""
      End If
      GetPath = strPath
    End FunctionPrivate Sub Command1_Click()
        MsgBox GetPath(Me.hWnd)
    End Sub
      

  2.   

    修改如下语句
    Private Sub Command1_Click()
        MsgBox GetPath() 'Me.hWnd)
    End Sub
      

  3.   

    Private Sub Command1_Click()
        MsgBox GetPath(Me.hWnd)
    End Sub
    我打错了改为
    Private Sub Command1_Click()
        MsgBox GetPath
    End Sub
      

  4.   

    foolishtiger兄,谢谢,堪称完美!送分,送分!