ASP FSO File Name Problem

Discussion in 'ASP .Net' started by KEN, Jul 25, 2007.

  1. KEN

    KEN Guest

    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 ;)
     
    KEN, Jul 25, 2007
    #1
    1. Advertising

  2. 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

    --
    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
     
    Peter Bucher [MVP], Jul 26, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jason

    database >> html file via FSO?

    jason, Aug 19, 2003, in forum: ASP General
    Replies:
    2
    Views:
    151
    Adrian Forbes - MVP
    Aug 19, 2003
  2. Vilmar Brazão de Oliveira

    Renaming a file with aspupload or FSO?

    Vilmar Brazão de Oliveira, Jan 13, 2004, in forum: ASP General
    Replies:
    5
    Views:
    193
    Roland Hall
    Jan 14, 2004
  3. Carol
    Replies:
    4
    Views:
    199
    Carol
    Jul 30, 2004
  4. tom

    Rename File with FSO

    tom, Oct 29, 2004, in forum: ASP General
    Replies:
    6
    Views:
    222
    thorpe
    Oct 29, 2004
  5. KEN

    ASP FSO File Name Problem

    KEN, Jul 25, 2007, in forum: ASP General
    Replies:
    0
    Views:
    94
Loading...

Share This Page