473,471 Members | 1,744 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 2684
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Dave D | last post by:
I don't want to learn Java, but... I'd like to build an AWT-based applet that takes text input from a user-supplied box (text box) and, if the text matches my secret phrase, pass the user into my...
0
by: Anthony Baxter | last post by:
To go along with the 2.4a3 release, here's an updated version of the decorator PEP. It describes the state of decorators as they are in 2.4a3. PEP: 318 Title: Decorators for Functions and...
2
by: lagunasun | last post by:
I am going from learning c++ console apps to windows, and need a good book. I prefer the non techical approach with some humor (if possible). I would like the book to assume the reader has NO...
2
by: eels | last post by:
Hello, how can I check whether a directory is readable or not. Are there differences between unix and windows? Thank you for your hints, Eels
145
by: Sidney Cadot | last post by:
Hi all, In a discussion with Tak-Shing Chan the question came up whether the as-if rule can cover I/O functions. Basically, he maintains it can, and I think it doesn't. Consider two...
2
by: ce | last post by:
Being a newbie regarding serialization and memorystreams, I was trying to see if i could improve page performance (avoiding going to the db on a postback) by saving my serialized business object in...
1
by: GenCode | last post by:
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...
94
by: Samuel R. Neff | last post by:
When is it appropriate to use "volatile" keyword? The docs simply state: " The volatile modifier is usually used for a field that is accessed by multiple threads without using the lock...
5
by: workingstiff19 | last post by:
I just want people to click on a link to download a file. I've done it before, but this is a new computer and I must be missing something. (Possibly an Apache configuration setting?) Here is...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.