The following is the asp code for reading all files (excluding subfolders) in the specified folder. xml is returned to facilitate interaction with flex.
'Create a FileSystemObject object example
Set MyFileObject = Server. CreateObject ("Scripting. FileSystemObject ")
'Create a Folder object
Foldername = server. mappath ("folder under server ./")
Set MyFolder = MyFileObject. GetFolder (foldername)
Str = "<? Xml version = '1. 0' encoding = 'utf-8'?> "& Vbcrlf &" <root> "& vbcrlf
'Put two raw data first to prevent bugs in interaction between only one record and flex (provided that at least one record exists in the folder, otherwise there will still be bugs)
Str = str & "<file>" & vbcrlf
Str = str & "<name> henhenhahi </name>" & vbcrlf
Str = str & "</file>" & vbcrlf
Str = str & "<file>" & vbcrlf
Str = str & "<name> henhenhahi, too </name>" & vbcrlf
Str = str & "</file>" & vbcrlf
'Show objects cyclically
I = 0
For Each thing in MyFolder. Files
Str = str & "<file>" & vbcrlf
Str = str & "<name>" & thing & "</name>" & vbcrlf
Str = str & "</file>" & vbcrlf
I = I + 1
Next
Str = str & "</root>" & vbcrlf
Response. write str
%>