SortDir (2)




<%
response.Write("File presenti:<p>")
Set fs=CreateObject("Scripting.FileSystemObject")
Set f=fs.GetFolder("c:\windows") ' directory che verra' esaminata
set fc=f.Files
numero_file=0
dim files(1000)
for Each whatever in fc
files(numero_file)=Trim(whatever.name)
numero_file=numero_file+1
next
set fs=Nothing
'

' Ordinamento files con tecnica select-sort

' (adatta per ordinare brevi liste per la sua compattezza)

'

for a=0 to numero_file-1
d=a
aa=files(a)
for b=a+1 to numero_file-1
if files(b)<aa then
d=b
aa=files(b)
end if
next
files(d)=files(a)
files(a)=aa
next
'

' Visualizza i files ordinati alfabeticamente

'

for t=0 to numero_file-1
response.write files(t)&"<br>"
next
%>
Per maggiori informazioni










( sortdir2.html )- by Paolo Puglisi - Modifica del 17/12/2023