Dim Pathlast$
Pathlast$=Dir1.List(Dir1.ListCount - 1)

解决方案 »

  1.   

    Private Sub Command1_Click()
        Print Dir1.List(Dir1.ListIndex) '选中的那个
        Print Dir1.List(Dir1.ListCount - 1) '最后一个
    End Sub
      

  2.   

    dim a() as string
    dim b as string
    a=split("c:\abc\def\gh","\")
    b=a(ubound(a))'b="gh"
      

  3.   

    Public Declare Function GetCurrentDirectory Lib "kernel32" Alias "GetCurrentDirectoryA" (ByVal bLen As Long, ByVal lpszBuffer As String) As Long
    Public Function CurrentDirectory() As String    Dim Str As String * 260
        Dim i As Integer
        
        GetCurrentDirectory 260, Str
        i = InStr(1, Str, Chr(0))
        CurrentDirectory = Mid(Str, 1, i - 1)
        
    End Function
      

  4.   

    用commondialog只显示文件夹的参数是什么?
    忘记了。
    请教!