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. Folder Listing

Folder Listing

Scheduled Pinned Locked Moved ASP.NET
sysadmin
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.
  • K Offline
    K Offline
    kirthikirthi
    wrote on last edited by
    #1

    Hi I am trying to List a folder Items which is in C:/ and my .aspx file is in server My code ------ Public Shared al As ArrayList al = New ArrayList Dim FtpUpFiles() As String If Directory.Exists("c:/songs/") Then FtpUpFiles = Directory.GetFiles("c:/songs/") If FtpUpFiles.Length > 0 Then Dim i As Integer For i = 0 To FtpUpFiles.Length - 1 al.Add(FtpUpFiles(i).ToString.Remove(0, FtpUpFiles(i).ToString.LastIndexOf("\") + 1)) Next al.Sort() dgUp1.Visible = True dgUp1.DataSource = al dgUp1.DataBind() End If ------------------ It is working in Local fine But not in the server How can access the folder form server Than Q Keerthi

    I G N 3 Replies Last reply
    0
    • K kirthikirthi

      Hi I am trying to List a folder Items which is in C:/ and my .aspx file is in server My code ------ Public Shared al As ArrayList al = New ArrayList Dim FtpUpFiles() As String If Directory.Exists("c:/songs/") Then FtpUpFiles = Directory.GetFiles("c:/songs/") If FtpUpFiles.Length > 0 Then Dim i As Integer For i = 0 To FtpUpFiles.Length - 1 al.Add(FtpUpFiles(i).ToString.Remove(0, FtpUpFiles(i).ToString.LastIndexOf("\") + 1)) Next al.Sort() dgUp1.Visible = True dgUp1.DataSource = al dgUp1.DataBind() End If ------------------ It is working in Local fine But not in the server How can access the folder form server Than Q Keerthi

      I Offline
      I Offline
      Imran Khan Pathan
      wrote on last edited by
      #2

      kirthikirthi wrote:

      Directory.Exists("c:/songs/")

      try following code

      Directory.Exists(Server.MapPath("c:/songs/"))

      best regard pathan

      1 Reply Last reply
      0
      • K kirthikirthi

        Hi I am trying to List a folder Items which is in C:/ and my .aspx file is in server My code ------ Public Shared al As ArrayList al = New ArrayList Dim FtpUpFiles() As String If Directory.Exists("c:/songs/") Then FtpUpFiles = Directory.GetFiles("c:/songs/") If FtpUpFiles.Length > 0 Then Dim i As Integer For i = 0 To FtpUpFiles.Length - 1 al.Add(FtpUpFiles(i).ToString.Remove(0, FtpUpFiles(i).ToString.LastIndexOf("\") + 1)) Next al.Sort() dgUp1.Visible = True dgUp1.DataSource = al dgUp1.DataBind() End If ------------------ It is working in Local fine But not in the server How can access the folder form server Than Q Keerthi

        G Offline
        G Offline
        Guffa
        wrote on last edited by
        #3

        If you mean that you want to access the folder on your computer from the server, that is not possible.

        --- "Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things." -- Douglas Adams

        1 Reply Last reply
        0
        • K kirthikirthi

          Hi I am trying to List a folder Items which is in C:/ and my .aspx file is in server My code ------ Public Shared al As ArrayList al = New ArrayList Dim FtpUpFiles() As String If Directory.Exists("c:/songs/") Then FtpUpFiles = Directory.GetFiles("c:/songs/") If FtpUpFiles.Length > 0 Then Dim i As Integer For i = 0 To FtpUpFiles.Length - 1 al.Add(FtpUpFiles(i).ToString.Remove(0, FtpUpFiles(i).ToString.LastIndexOf("\") + 1)) Next al.Sort() dgUp1.Visible = True dgUp1.DataSource = al dgUp1.DataBind() End If ------------------ It is working in Local fine But not in the server How can access the folder form server Than Q Keerthi

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

          This is not possible, because ASP.NET can access the directories which is located in side the virtual directory or allowed space.


          My Website | Ask smart questions

          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