取得文件或文件夹的基名称

代码:

<!DOCTYPE html>

<html>

<body>

 

<%

Set fs=Server.CreateObject("Scripting.FileSystemObject")

 

Response.Write(fs.GetBaseName("c:\winnt\cursors\3dgarro.cur"))

Response.Write("<br>")

Response.Write(fs.GetBaseName("c:\winnt\cursors\"))

Response.Write("<br>")

Response.Write(fs.GetBaseName("c:\winnt\"))

 

set fs=nothing

%>

 

</body>

</html>

结果:

3dgarro
cursors
winnt

相关文章