Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. read files from folder

read files from folder

Scheduled Pinned Locked Moved C#
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    btota
    wrote on last edited by
    #1

    i have a folder in my documents named skins i want to read the all files name in this folder how can do it

    fatma

    S A C 3 Replies Last reply
    0
    • B btota

      i have a folder in my documents named skins i want to read the all files name in this folder how can do it

      fatma

      S Offline
      S Offline
      Stefan Troschuetz
      wrote on last edited by
      #2

      Take a look at the Directory and DirectoryInfo class.


      "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook

      www.troschuetz.de

      1 Reply Last reply
      0
      • B btota

        i have a folder in my documents named skins i want to read the all files name in this folder how can do it

        fatma

        A Offline
        A Offline
        Aaron Dilliard
        wrote on last edited by
        #3

        string[] files=Directory.GetFiles(skinsFolder); As a note, you will have the full path. If you only want the file name, just get a substring of the last index of '\'. Aaron

        1 Reply Last reply
        0
        • B btota

          i have a folder in my documents named skins i want to read the all files name in this folder how can do it

          fatma

          C Offline
          C Offline
          chandler83
          wrote on last edited by
          #4

          as Aaron said, assign the retrived file array to a fileinfo object and use the properties to get the filename or extension. FileInfo fileinfo = new FileInfo(files[0]); long sFileSize = fileinfo.Length;(gives u the file size) fileinfo.Directory etc.......

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups