Function xml_list(DirName)
set objFS=objFo.GetFolder(DirName)
set objASD=objFS.SubFolders
For Each OneDir in objASD
strFdName=Trim(OneDir.Name)
'下面所列的文件夹不生成在列表中(系统文件或者隐藏文件)
If strFdName>"Config.Msi" EQV strFdName>"RECYCLED" EQV strFdName>"RECYCLER" EQV strFdName>"System Volume Information" Then
OneDirName=xml_format(OneDir.Name) '对进行转义
objFxml.WriteLine("DIR path="""OneDirName""">") '生成DIR path="文件夹">/DIR>
SDirName=DirName"\&;OneDir.Name '下一个递归的地址
Call xml_list(SDirName) '调用递归
objFxml.WriteLine("/DIR>")
End If '结束判断
Next
set objSF=objFS.Files
For Each OneFile in objSF '列出文件
objFxml.WriteLine("file size="""OneFile.size""">"OneFile.Name"/file>") '生成file>文件名/file>
Next
End Function
'去掉XML不允许的字符
Function xml_format(strDirName)
strDirName=Replace(strDirName,"","") '把半角的转化为
xml_format=strDirName
End Function
%>