国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > ASP > 正文

讀取目錄下的所有文件(包括子目錄下的所有文件)

2024-05-04 10:58:52
字體:
來源:轉載
供稿:網友
******************************

Many times we might need some part of code which will access all sub-folders of the server and also all
files within the sub-folder.
The following line of asp code will map to a specified folder and searches all the sub-folders
(Not recursively, code can be extended to do) and reads all files(basically text files) one by one.

You can specify any folder name, in the remarks given in the code (within " ")

'Create a File system Object
set FileSystem=server.CreateObject("scripting.filesystemobject")

dim dbconn

folderpath=server.MapPath("main Folder path" )
set sfolder=Filesystem.GetFolder(folderpath).SubFolders
for each FolderItem in sfolder
set Files=FolderItem.Files
for each FileItem in Files
fname=server.MapPath( "main folder path" & FolderItem.Name & "/" & FileItem.Name
set File=FileSystem.OpenTextFile(fname,1,false)
while File.AtEndofStream <> True
record=split(File.Readline,"~")
wend
File.close
FileSystem.DeleteFile(fname)
next
next


******************************

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 汤阴县| 平陆县| 东莞市| 福泉市| 左权县| 兖州市| 开阳县| 准格尔旗| 庐江县| 泗洪县| 沁阳市| 宜春市| 中牟县| 东莞市| 广水市| 武汉市| 安平县| 台中县| 方城县| 贵南县| 双鸭山市| 长宁县| 肥西县| 德惠市| 壤塘县| 巴林左旗| 阳东县| 怀宁县| 咸宁市| 岐山县| 成都市| 南丹县| 会泽县| 寿宁县| 南投市| 博野县| 会昌县| 饶平县| 榆中县| 缙云县| 嘉祥县|