469,912 Members | 1,727 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,912 developers. It's quick & easy.

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

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,

Apr 9 '07 #1
5 2392
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


"GenCode" wrote:
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,

Apr 9 '07 #2
On Apr 9, 6:54 am, Peter Bromberg [C# MVP]
<pbromb...@yahoo.yabbadabbadoo.comwrote:
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

"GenCode" wrote:
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,
Apr 9 '07 #3
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" wrote:
On Apr 9, 6:54 am, Peter Bromberg [C# MVP]
<pbromb...@yahoo.yabbadabbadoo.comwrote:
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

"GenCode" wrote:
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,
Apr 10 '07 #4
On Apr 10, 8:54 am, Peter Bromberg [C# MVP]
<pbromb...@yahoo.yabbadabbadoo.comwrote:
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" wrote:
On Apr 9, 6:54 am, Peter Bromberg [C# MVP]
<pbromb...@yahoo.yabbadabbadoo.comwrote:
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
"GenCode" wrote:
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,

Apr 10 '07 #5
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" wrote:
On Apr 10, 8:54 am, Peter Bromberg [C# MVP]
<pbromb...@yahoo.yabbadabbadoo.comwrote:
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" wrote:
On Apr 9, 6:54 am, Peter Bromberg [C# MVP]
<pbromb...@yahoo.yabbadabbadoo.comwrote:
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
"GenCode" wrote:
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,

Apr 10 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Dave D | last post: by
2 posts views Thread by lagunasun | last post: by
2 posts views Thread by eels | last post: by
145 posts views Thread by Sidney Cadot | last post: by
1 post views Thread by GenCode | last post: by
94 posts views Thread by Samuel R. Neff | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.