ASP retrieval website specifies the algorithm and application direction of the directory file

zhaozj2021-02-08  297

There is such a problem in our many websites, which is the maintenance update of links. This is a very work product. If the special staff is maintained, the site update maintenance work is basically A very headache problem, especially if there are no many people's hands, it is hateful to maintain the update link, because this work does not have much creativity, but it is time consuming, and Jack is obviously not that kind of favorite Time in a creative thing, with yes, Jack came up with an ASP program prototype, let it complete the work we hate! Now we assume that you have such a website maintenance task, that is to link every month's economic review to everyone to view, these comments involve various aspects of economic operation, there may be gross domestic product, price index There is an industrial development, and they have a common feature, that is, their file name represents the contents of their own comments, examples: "Analysis of the completion of GDP in 1999 in 1999", in so many suitable Suppose it is (, assuming almost more than Samuelson's economics!), The opportunity of our deck is coming! As long as we copy these files to the subdirect record corresponding to this directory, then write an ASP page, the function it complete is to retrieve the file below the specified directory, and retrieve the results to make a click link, then we should write ? Very simple, we only need to give the ASP to the file name collection in the specified directory, and traverse this collection, make each element of the collection to make the corresponding link for everyone to choose, it is! Also, to query all file names containing a feature string within all economic classes? Small Case! You just want to put the function of the search file into a recursive directory search function! (嘻, don't tell me, you won't recurquity!) This, we can also write a song system (, I like to listen to MP3) to make the singer in the directory name, plus the Chinese name, everything is OK. ! Want to listen to "love" song? OK! Improviate the words! You can find all the songs that love! (For example: love you love to bones! Hey, ribs! Jack main sing!) In addition, you plus the extended code (remove the code of the specified file), if you cooperate with UPLOAD ASP code, you can even write a remote Web maintenance system! Of course, this kind of thing Jack is not done! ASP is not perfect enough, read and write in binary documents! So can only manipulate text files, 嘻嘻, beautiful dream soup? Don't close, use VC! Write isapi to do it! The following code, because the comment is complete (Jack is not online in the afternoon! Hey, I don't know how much MM is waiting for me in Chat, I have to have a heartbeat!), I will not say, please Analysis! <% 'From the FORM Variable Set to the file name to be queried, the string DATA = Request.Form ("Search_Data")' call function query the rule of all subdirectories in the target query directory (all subtrands) 'function calls :

Search_folder (To query strings, query target virtual path, query target's true absolute path) P = search_folder (data, "http: // jack / cgi-bin", "C: / Webshare / wwwroot / cgi- bin ")%>