Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP FSO File Name Problem

Reply
Thread Tools

ASP FSO File Name Problem

 
 
KEN
Guest
Posts: n/a
 
      07-25-2007
I have a script that reads a directory and creates a xml doc based on
that directory. I just got the file count and walked through it adding
lines to the xml.
I used
While int(filecount) >= b
xml_to_silo_string3 = xml_to_silo_string3 & "<FILE" & b &">"
xml_to_silo_string3 = xml_to_silo_string3 & "0-" & tempPageNumber
& "</FILE" & b &">"
tempPageNumber = tempPageNumber + 1

b = b+1
Wend
Now we need to have both jpegs and tiffs in the directory. So I need
to get the extensions. No problem right? .... wrong the files are
named 01, 02, 03, 04 .... 010 etc.. and they have to stay in order in
xml. So I tried

For each file in files_collection
xml_to_silo_string3 = xml_to_silo_string3 & "<FILE" & b &">"
xml_to_silo_string3 = xml_to_silo_string3 & file.Name & "</FILE" & b
&">"
b = b+1
Next

But that gives me file 01 then 010 then 011 not 01, 02, 03 which is
what I need.

Does anybody know how to loop through the directory sequentially?
thanks

 
Reply With Quote
 
 
 
 
Peter Bucher [MVP]
Guest
Posts: n/a
 
      07-26-2007
Hi Ken

> But that gives me file 01 then 010 then 011 not 01, 02, 03 which is
> what I need.
>
> Does anybody know how to loop through the directory sequentially?
> thanks

The class in the following Url provides possibilities to order a filelist.
-
http://www.aspfaq.de/index.asp?RID=5...5&OSST=&OSFI=1

--
Gruss, Peter Bucher
Microsoft MVP - Visual Developer ASP / ASP.NET, Switzerland
http://www.aspnetzone.de/ - ASP.NET Zone, die ASP.NET Community
http://www.aspnetzone.de/blogs/peterbucher/ - Auf den Spuren von .NET


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP FSO File Name Problem KEN ASP General 0 07-25-2007 03:52 PM
Rename File with FSO tom ASP General 6 10-29-2004 03:13 PM
FSO delete the very last character in tgext file Carol ASP General 4 07-30-2004 01:33 AM
Renaming a file with aspupload or FSO? Vilmar Braz„o de Oliveira ASP General 5 01-14-2004 11:06 PM
database >> html file via FSO? jason ASP General 2 08-19-2003 10:52 AM



Advertisments