|
以下 ASP代码 用于列出“我的电脑”文件夹中的项目。为此需要对象“Shell.Application”。
- Const MY_COMPUTER = &H11&
- Set objShell = Server.CreateObject("Shell.Application")
- Set objFolder = objShell.Namespace(MY_COMPUTER)
- Set objFolderItem = objFolder.Self
- Response.Write(objFolderItem.Path&"<br />")
- Set colItems = objFolder.Items
- For Each objItem in colItems
- Response.Write(objItem.Name)
- Response.Write("<br />")
- Next
- Set colItems = Nothing
- Set objShell = Nothing
- Set objFolder = Nothing
- Set objFolderItem = Nothing
复制代码
|
|