Site
Http://btyz.51web.cn/collection.asp Using time-arranged files, then think that if the time established according to the file is, it is great. Fortunately, I have learned C language, and the bubbling method is just a simple algorithm, but what algorithm to use in web programming is still relatively small, I have used the algorithm only recursive and bubble. There are questions. This algorithm is not very high. I don't know if there is a better way.
<% @Language = "vbscript" CODEPAGE = "936"%> <% '############################### ###### '' ## copyright (c) 2003 Drunken Wentry All Rights Reserved. ## '' ## Powered By Drunken Rain Wutong ## '## http://btyz.51web.cn/ # # '## winterfire@163.com ##' '####################################################################################################################################################################################################################################################################################### ## 'function file_list (path) set fso = server.createObject ("scripting.filesystemObject")' FSO object set fd = fso.getFolder (PATH) get folder set f = fd.files' get file in Folder FOR Each OneFile In F 'lists all TXT file filename = onefile.name if lcase (Right (filename, 3)) = "txt" THEN' only for TXT file processing filename_arr0 = filename_arr0 & left (filename, len (filename) -4) & "|" 'Get the master file name, save it in the variable, 0 | 0 | Formal FileName_arr1 = filename_arr1 & datevalue (onefile.datecreated) & "|" get file creation date end if next filename_arr0 = split (filename_arr0, "| | 'Translate into file name array filename_arr1 = split (filename_arr1, "|")' Transformation to date array 'Put file name and time in order to add two-dimensional array DIM filename_arr () redim filename_a RR (filename_arr0), 2) 'redefines for i = 0 to ubound (filename_arr0) -1 filename_arr (i, 0) = filename_arr0 (i) FileName_arr (i, 1) = filename_arr1 (i) Next Erase FileName_arr0' Delete Array ERASE FileName_arr1 '------ Use the bubble method in the order of time ------ for j = 0 to ubound (filename_arr) -1 for i = 0 to ubound (filename_arr) -1-j If Datediff ("D", FileName_arr (i, 1), FileName_arr (i 1, 1))> 0 THEN 'Judgment time,
If it is better than the late evening, exchange data 'if filename_arr (i, 1)