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. Get C drive files

Get C drive files

Scheduled Pinned Locked Moved ASP.NET
questioncsharpasp-netsysadminhelp
5 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.
  • C Offline
    C Offline
    cocoonwls
    wrote on last edited by
    #1

    Dear all, I am using asp.net with c# 2005, .NET 2.0. How can i get all the file in directory C in server? I am tring to use DirectoryInfo to get the files, but the problem is what is the valid path for C drive in server?i try to use server.mapPath(@"~"),but only can get the path in wwwroot... Any tips or helps are welcome thanks in advance regards cocoonwls

    N 1 Reply Last reply
    0
    • C cocoonwls

      Dear all, I am using asp.net with c# 2005, .NET 2.0. How can i get all the file in directory C in server? I am tring to use DirectoryInfo to get the files, but the problem is what is the valid path for C drive in server?i try to use server.mapPath(@"~"),but only can get the path in wwwroot... Any tips or helps are welcome thanks in advance regards cocoonwls

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      cocoonwls wrote:

      but only can get the path in wwwroot...

      Yes. This is how it works. You don't have access to other paths on the server. Why do you want to get the files in C drive?

      Navaneeth How to use google | Ask smart questions

      C 1 Reply Last reply
      0
      • N N a v a n e e t h

        cocoonwls wrote:

        but only can get the path in wwwroot...

        Yes. This is how it works. You don't have access to other paths on the server. Why do you want to get the files in C drive?

        Navaneeth How to use google | Ask smart questions

        C Offline
        C Offline
        cocoonwls
        wrote on last edited by
        #3

        Hi Navaneeth, Due to user will upload their files to the c drive share folder.then they can retrieve the related files by using web application.And i don't wish the user can access the wwwroot file. Thus ,this is the reason i have to do the way. thanks in advance regards cocoonwls

        N 1 Reply Last reply
        0
        • C cocoonwls

          Hi Navaneeth, Due to user will upload their files to the c drive share folder.then they can retrieve the related files by using web application.And i don't wish the user can access the wwwroot file. Thus ,this is the reason i have to do the way. thanks in advance regards cocoonwls

          N Offline
          N Offline
          N a v a n e e t h
          wrote on last edited by
          #4

          Well, these are the restrictions when you work with web applications. You will not get access to other places except wwwroot. I suggest to rethink your design.

          Navaneeth How to use google | Ask smart questions

          C 1 Reply Last reply
          0
          • N N a v a n e e t h

            Well, these are the restrictions when you work with web applications. You will not get access to other places except wwwroot. I suggest to rethink your design.

            Navaneeth How to use google | Ask smart questions

            C Offline
            C Offline
            cocoonwls
            wrote on last edited by
            #5

            Ok..i got it..thanks of your reply.But i think that is the only way i can do :doh: regards cocoonwls

            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