Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / July 2007

Tip: Looking for answers? Try searching our database.

ASP FSO File Name Problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
KEN - 25 Jul 2007 16:55 GMT
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 ;)
Peter Bucher [MVP] - 26 Jul 2007 07:55 GMT
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&FID=114&SFI=1&ELE=9928&OPID=0&ORID=5&OSST=&
OSFI=1


Signature

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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.