ASP应用怎样获取文件夹名称并保存到ACC数据库里面
- 提问者网友:原来太熟悉了会陌生
- 2021-07-30 17:28
- 五星知识达人网友:人间朝暮
- 2021-07-30 17:54
<%
Dim objFSO,objFolder ''声明一个名称为 objFSO 的变量以存放对象实例
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
If objFSO.FolderExists(Server.MapPath("\")) Then
Response.Write "上一级目录:" &objFSO.GetParentFolderName(Server.MapPath("\"))&"<br>"
Response.Write "系统文件夹目录:" &objFSO.GetSpecialFolder(WindowsFolder)&"<br>"
Set objFolder = objFSO.GetFolder(Server.MapPath("\"))
Response.Write "文件夹的名称:"&objFolder.Name&"<br>"
Response.Write "文件夹的路径:"&objFolder.Path&"<br>"
Response.Write "文件夹的路径:"&objFolder.size/1024/1024&"<br>"
Response.Write "文件夹的建立日期:"&objFolder.DateCreated&"<br>"
Else
Response.Write "文件夹"&Server.MapPath("\new\work\NewFolder")&"不存在,无法读取相关信息!"
End If
Set objFolder = Nothing
Set objFSO = Nothing ''释放 FileSystemObject 对象实例内存空间
%>