台湾“大选”马英九得票破700万自行宣布当选!
当前位置:金诺VB园文章教程技巧文章 → 从全路径名中提取文件名

从全路径名中提取文件名

减小字体 增大字体 作者:佚名  来源:不详  发布时间:2008-1-31 17:34:44
Function StripPath(T$) As String
Dim x%, ct%
StripPath$ = T$
x% = InStr(T$, "\")
Do While x%
ct% = x%
x% = InStr(ct% + 1, T$, "\")
Loop
If ct% > 0 Then StripPath$ = Mid$(T$, ct% + 1)
End Function
例子:
File = StripPath("c:\windows\hello.txt"