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

首頁 > 編程 > ASP > 正文

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

2020-07-27 13:22:57
字體:
來源:轉載
供稿:網友
******************************

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


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

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 长海县| 南汇区| 沂源县| 政和县| 库车县| 察哈| 普兰店市| 吉安县| 津市市| 商河县| 绍兴县| 郧西县| 古蔺县| 六安市| 海晏县| 侯马市| 乡城县| 沂南县| 长子县| 宜州市| 当雄县| 三门县| 潼南县| 上杭县| 林州市| 金沙县| 绥江县| 额敏县| 台东县| 岢岚县| 宜君县| 盈江县| 白银市| 海伦市| 房山区| 甘洛县| 炉霍县| 兰州市| 会泽县| 西畴县| 汉川市|