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

首頁 > 學院 > 開發設計 > 正文

讀取目錄下的所有文件(源碼)

2019-11-18 22:02:33
字體:
來源:轉載
供稿:網友
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
     
     
     
     
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 新建县| 古田县| 大渡口区| 江华| 望谟县| 绥芬河市| 郎溪县| 达日县| 射阳县| 普宁市| 中方县| 高邑县| 马关县| 宁化县| 林甸县| 克东县| 福州市| 安义县| 满城县| 宁强县| 平南县| 桐城市| 延庆县| 崇信县| 汕头市| 科技| 资溪县| 泽库县| 镇江市| 闽侯县| 微山县| 万安县| 曲靖市| 丰都县| 浦东新区| 慈溪市| 霍州市| 长治县| 甘肃省| 依安县| 松滋市|