By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,889 Members | 1,373 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,889 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
5 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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.