What is the best way to read a HTML "readable" web directory...

G

GenCode

What is the best way to read a "readable" web directory...

I know I can do this
Client.DownloadFile("http://www.mydomain.com/readabledir/", c:\
\dir.txt");

But that gives me the html and all the other tags...all I want is a
directory listing of all the *.gif in this dir and not all the html

Now I know I can parse the html to get the gif file names...but I
wanted to ask before I do this to see if I am overlooking something
that is already built into .NET

Thanks, Ed,
 
G

Guest

Unless your server is enabled for WEBDAV, you would need to do this at the
server using the Directory and GetFiles method with a filter (e.g., "*.gif).

This probably belongs in the ASP.NET newsgroup, it's not really C# language
specific.
Peter
 
G

GenCode

Unless your server is enabled for WEBDAV, you would need to do this at the
server using the Directory and GetFiles method with a filter (e.g., "*.gif).

This probably belongs in the ASP.NET newsgroup, it's not really C# language
specific.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net









- Show quoted text -

Its not a ASP.NET application and its not hitting an ASP.NET web
server...this is a C# desktop application I wrote that needs to get
info from any sever...ASP.NET, ASP or even Apache web servers.

The C# desktop applicaion is calling

System.Net.WebClient Client = new System.Net.WebClient();
Client.DownloadFile(...)

There is no ASP.NET involved at all

But I will ask there too since maybe someone there has seen it.

Thanks for the respnse.

Ed,
 
G

GenCode

The problem you have here is that, unless directory browsing is turned on
(which would provide you with a web page full of links to all the files in
the folder) there is no way to determine what files are in the directory.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net












- Show quoted text -

Yes, the directory browsing is turned on, it is a browsable
directory...I can see all the files in a list form just fine...I can
see all the files like this
Parent Directory
File1.gif
File2.gif
File3.gif

I think the only solution is to parse the html...I will just go that
route.

Thanks again, Ed,
 
G

Guest

Yep. That should not be too difficult as all the links will look the same in
the page.
A little Regex will do the trick. Best of luck with your project.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net




GenCode said:
The problem you have here is that, unless directory browsing is turned on
(which would provide you with a web page full of links to all the files in
the folder) there is no way to determine what files are in the directory.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net



GenCode said:
On Apr 9, 6:54 am, Peter Bromberg [C# MVP]
Unless your server is enabled for WEBDAV, you would need to do this at the
server using the Directory and GetFiles method with a filter (e.g., "*.gif).
This probably belongs in the ASP.NET newsgroup, it's not really C# language
specific.
Peter
:
What is the best way to read a "readable" web directory...
I know I can do this
Client.DownloadFile("http://www.mydomain.com/readabledir/", c:\
\dir.txt");
But that gives me the html and all the other tags...all I want is a
directory listing of all the *.gif in this dir and not all the html
Now I know I can parse the html to get the gif file names...but I
wanted to ask before I do this to see if I am overlooking something
that is already built into .NET
Thanks, Ed,- Hide quoted text -
- Show quoted text -
Its not a ASP.NET application and its not hitting an ASP.NET web
server...this is a C# desktop application I wrote that needs to get
info from any sever...ASP.NET, ASP or even Apache web servers.
The C# desktop applicaion is calling
System.Net.WebClient Client = new System.Net.WebClient();
Client.DownloadFile(...)
There is no ASP.NET involved at all
But I will ask there too since maybe someone there has seen it.
Thanks for the respnse.
Ed,- Hide quoted text -

- Show quoted text -

Yes, the directory browsing is turned on, it is a browsable
directory...I can see all the files in a list form just fine...I can
see all the files like this
Parent Directory
File1.gif
File2.gif
File3.gif

I think the only solution is to parse the html...I will just go that
route.

Thanks again, Ed,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top