directory read

Results 1 to 2 of 2

Thread: directory read

  1. #1
    Join Date
    Dec 1969

    Default directory read

    a.jpg<BR>as.jpg<BR>b.jpg<BR>c.jpg<BR><BR>how can i read files in this directory which dont begin with the letter "a" ?

  2. #2
    Join Date
    Dec 1969

    Default RE: directory read

    ArrayList ValidFiles = new ArrayList();<BR>object[] FileArray = System.IO.Directory.GetFiles(Server.MapPath(path)) ; <BR> <BR>foreach(string f in FileArray)<BR>{<BR> FileInfo fInfo = new FileInfo(f);<BR> if (!(fInfo.Name.StartsWith("a")))<BR> {<BR> ValidFile.Add("f");<BR> }<BR> <BR> fInfo.Dispose();<BR>}<BR> <BR>---------------<BR>ValidFile now contains only files that don&#039;t start with the letter "a"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts