格式
c:\aaa\123456.txt
c:\aaa\123456789.txt
c:\aaa\123.txt
现在想去出文本文件名称,但文本文件名称不固定,不知道改如何取,请各位帮忙。感谢。

解决方案 »

  1.   

    把下列代码拷到VB窗体中执行吧:Option ExplicitPrivate Sub Command1_Click()
        Dim str1 As String
        Dim j As Integer
        Dim strfile As String
        
        Dim tmp() As String
        
        str1 = Trim(Text1.Text)
        tmp = Split(str1, "\")
        j = UBound(tmp)
        strfile = tmp(j)
        MsgBox strfile
    End SubPrivate Sub Form_Load()
        Text1.Text = "d:\jadlksfj\jakdlsjf\黑乎乎.txt"
    End Sub