Originally, this XML document was generated to develop an ftp search, but later, since there was no information reference to how to search for the XML document, it was abandoned. The most important one was the recursive algorithm. The speed of generating file lists was very fast. This program can be used to generate playlists and other things. It requires support from IIS's FSO component. Generate XML documents similar to the following
<?xml version="1.0" encoding="gb2312"?>
<ftp ip="10.1.228.228">
<DIR path="Game">
<DIR path="Legend of Sword and Fairy 2 (save)">
<file size="346294">complete_camel.rar</file>
<file size="1886286">complete_funlove.rar</file>
</DIR>
</DIR>
</ftp>
make_file_list.asp
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
'######################################'
'## Copyright (C) 2003 Zuiyu Wutong All rights reserved. ##'
'## Powered by Drunken Rain Wutong ##'
'## http://btyz./ ##'
'## winterfire@ ##'
'######################################'
Dim objFo,objF,objAF,objFxml
set objFo=CreateObject("") 'Object
set objFxml=("G:\My Documents\http\Personal Works\FTP_Search\",2) 'Open file
("<?xml version=""1.0"" encoding=""gb2312""?>")
("<ftp ip=""10.1.228.228"">")
Call xml_list("F:\") 'Start list
("</ftp>")
("List is OK!) 'The list succeeds
Function xml_list(DirName)
set objFS=(DirName)
set objASD=
For Each OneDir in objASD
strFdName=Trim()
'The folders listed below are not generated in the list (system files or hidden files)
If strFdName<>"" EQV strFdName<>"RECYCLED" EQV strFdName<>"RECYCLER" EQV strFdName<>"System Volume Information" Then
OneDirName=xml_format() 'Escape &
("<DIR path="""&OneDirName&""">") 'Generate <DIR path="Folder"></DIR>
SDirName=DirName&"\"& 'Next recursive address
Call xml_list(SDirName) 'Call recursion
("</DIR>")
End If 'End Judgment
Next
set objSF=
For Each OneFile in objSF 'List the files
("<file size="""&&""">"&&"</file>") 'Generate <file>filename</file>
Next
End Function
'Remove characters that are not allowed by XML
Function xml_format(strDirName)
strDirName=Replace(strDirName,"&","&") 'Convert half of the & into &
xml_format=strDirName
End Function
%>
<?xml version="1.0" encoding="gb2312"?>
<ftp ip="10.1.228.228">
<DIR path="Game">
<DIR path="Legend of Sword and Fairy 2 (save)">
<file size="346294">complete_camel.rar</file>
<file size="1886286">complete_funlove.rar</file>
</DIR>
</DIR>
</ftp>
make_file_list.asp
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
'######################################'
'## Copyright (C) 2003 Zuiyu Wutong All rights reserved. ##'
'## Powered by Drunken Rain Wutong ##'
'## http://btyz./ ##'
'## winterfire@ ##'
'######################################'
Dim objFo,objF,objAF,objFxml
set objFo=CreateObject("") 'Object
set objFxml=("G:\My Documents\http\Personal Works\FTP_Search\",2) 'Open file
("<?xml version=""1.0"" encoding=""gb2312""?>")
("<ftp ip=""10.1.228.228"">")
Call xml_list("F:\") 'Start list
("</ftp>")
("List is OK!) 'The list succeeds
Function xml_list(DirName)
set objFS=(DirName)
set objASD=
For Each OneDir in objASD
strFdName=Trim()
'The folders listed below are not generated in the list (system files or hidden files)
If strFdName<>"" EQV strFdName<>"RECYCLED" EQV strFdName<>"RECYCLER" EQV strFdName<>"System Volume Information" Then
OneDirName=xml_format() 'Escape &
("<DIR path="""&OneDirName&""">") 'Generate <DIR path="Folder"></DIR>
SDirName=DirName&"\"& 'Next recursive address
Call xml_list(SDirName) 'Call recursion
("</DIR>")
End If 'End Judgment
Next
set objSF=
For Each OneFile in objSF 'List the files
("<file size="""&&""">"&&"</file>") 'Generate <file>filename</file>
Next
End Function
'Remove characters that are not allowed by XML
Function xml_format(strDirName)
strDirName=Replace(strDirName,"&","&") 'Convert half of the & into &
xml_format=strDirName
End Function
%>