取得某个指定路径的父文件夹的名称

代码:

<!DOCTYPE html>

<html>

<body>

 

<%

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

p=fs.GetParentFolderName("c:\winnt\cursors\3dgarro.cur")

 

Response.Write("The parent folder name of c:\winnt\cursors\3dgarro.cur is: " & p)

 

set fs=nothing

%>

 

</body>

</html>

结果:

The parent folder name of c:\winnt\cursors\3dgarro.cur is: c:\winnt\cursors

相关文章