CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2001
    Location
    Melbourne/Aus (C# .Net 4.0)
    Posts
    686

    Listing files at a URL

    Does anyone know how (or if it is possible) to get a directory listing for a given URL?

    I thought I had it working using HttpWebRequest and specifying the URL and the parsing the HTML directory listing (yuck) that it returned.

    However, if the directory contains a file called say "default.htm", then the HTML contents of that file are returned instead of the HTML directory listing.

    Is there a smarter way to aceive my goal?

    Note: It's read-only, so I don't want to use FTP with a User Id and Password.
    Rob
    -
    Ohhhhh.... Old McDonald was dyslexic, E O I O EEEEEEEEEE.......

  2. #2
    Join Date
    Mar 2004
    Location
    Prague, Czech Republic, EU
    Posts
    1,701

    Re: Listing files at a URL

    If I look over HTTP protocol, I see no way how to do it. It is possible only if server is configured to do this.
    • Make it run.
    • Make it right.
    • Make it fast.

    Don't hesitate to rate my post.

  3. #3
    Join Date
    Jun 2001
    Location
    Melbourne/Aus (C# .Net 4.0)
    Posts
    686

    Re: Listing files at a URL

    boudino, I'm tending to agree with you. I suspect it would be a security issue if you could do this by default.
    Rob
    -
    Ohhhhh.... Old McDonald was dyslexic, E O I O EEEEEEEEEE.......

  4. #4
    Join Date
    Jan 2010
    Location
    .NET v3.5 SP1, VS 2008
    Posts
    18

    Re: Listing files at a URL

    Then how do search engines work?

  5. #5
    Join Date
    Mar 2004
    Location
    Prague, Czech Republic, EU
    Posts
    1,701

    Re: Listing files at a URL

    By following links and parsing HMTL documents returned from server.
    • Make it run.
    • Make it right.
    • Make it fast.

    Don't hesitate to rate my post.

  6. #6
    Join Date
    Jan 2010
    Location
    .NET v3.5 SP1, VS 2008
    Posts
    18

    Re: Listing files at a URL

    thus creating a directory listing

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured