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. Web Development
  3. ASP.NET
  4. Getting the contents of directory where default.aspx file is located?

Getting the contents of directory where default.aspx file is located?

Scheduled Pinned Locked Moved ASP.NET
questionvisual-studiocsharpdata-structureshelp
4 Posts 2 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.
  • Z Offline
    Z Offline
    Zhendalf
    wrote on last edited by
    #1

    Hi to all. I have problem here. I need to get array of directories contained in the directory where my default.aspx is. If I write so: DirectoryInfo dir1 = new DirectoryInfo(@"."); I'm getting the "C:\Program Files\Microsoft Visual Studio 8\Common7\IDE" directory. My question is: how can I get the DirectoryInfo of the directory where my default.aspx file is, not pointing to DirectoryInfo constructor the whole path?

    L 1 Reply Last reply
    0
    • Z Zhendalf

      Hi to all. I have problem here. I need to get array of directories contained in the directory where my default.aspx is. If I write so: DirectoryInfo dir1 = new DirectoryInfo(@"."); I'm getting the "C:\Program Files\Microsoft Visual Studio 8\Common7\IDE" directory. My question is: how can I get the DirectoryInfo of the directory where my default.aspx file is, not pointing to DirectoryInfo constructor the whole path?

      L Offline
      L Offline
      laddie 0
      wrote on last edited by
      #2

      string[] dirs = Directory.GetDirectories(Server.Mappath("")); Please let me know if it helps.

      Z 2 Replies Last reply
      0
      • L laddie 0

        string[] dirs = Directory.GetDirectories(Server.Mappath("")); Please let me know if it helps.

        Z Offline
        Z Offline
        Zhendalf
        wrote on last edited by
        #3

        Should I include some additional namespace?

        1 Reply Last reply
        0
        • L laddie 0

          string[] dirs = Directory.GetDirectories(Server.Mappath("")); Please let me know if it helps.

          Z Offline
          Z Offline
          Zhendalf
          wrote on last edited by
          #4

          Thank you a lot. It really helped. :-D

          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