PC Review


Reply
Thread Tools Rate Thread

How can I read the files of a directory on a web server?

 
 
=?Utf-8?B?TmljbyBQLg==?=
Guest
Posts: n/a
 
      15th Nov 2005
ok, here is my situation:
I want to create an app that dynamically loads new components from a web
server. to do that I have to read all files in a directory on the webserver.
How can I do that?
 
Reply With Quote
 
 
 
 
Kevin Spencer
Guest
Posts: n/a
 
      15th Nov 2005
System.IO.Directory
System.IO.DirectoryInfo
System.IO.File
System.IO.FileInfo

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
If you push something hard enough,
it will fall over.
- Fudd's First Law of Opposition

"Nico P." <(E-Mail Removed)> wrote in message
news:F7C3E898-29BF-4334-9980-(E-Mail Removed)...
> ok, here is my situation:
> I want to create an app that dynamically loads new components from a web
> server. to do that I have to read all files in a directory on the
> webserver.
> How can I do that?



 
Reply With Quote
 
=?Utf-8?B?TmljbyBQLg==?=
Guest
Posts: n/a
 
      15th Nov 2005
I already know these classes and I tried this:

If System.IO.Directory.Exists("http://localhost/ACalcComponents/") Then
Me.txtError.Text = "Yeah!"
Else
Me.txtError.Text = "D'oh!"
End If

the answer is "D'oh", although the directory exists. I don't really know how
the path string should look like? I also tried it with
"file:///localhost/ACalcComponents/" , but I also doesn't work. Can you
please give me a small example of your solution?


"Kevin Spencer" wrote:

> System.IO.Directory
> System.IO.DirectoryInfo
> System.IO.File
> System.IO.FileInfo
>
> --
> HTH,
>
> Kevin Spencer
> Microsoft MVP
> ..Net Developer
> If you push something hard enough,
> it will fall over.
> - Fudd's First Law of Opposition
>
> "Nico P." <(E-Mail Removed)> wrote in message
> news:F7C3E898-29BF-4334-9980-(E-Mail Removed)...
> > ok, here is my situation:
> > I want to create an app that dynamically loads new components from a web
> > server. to do that I have to read all files in a directory on the
> > webserver.
> > How can I do that?

>
>
>

 
Reply With Quote
 
=?Utf-8?B?TmljbyBQLg==?=
Guest
Posts: n/a
 
      15th Nov 2005
i should mention that I want a client (that runs on a different computer) to
get the files from the directory on the web server.
 
Reply With Quote
 
Kevin Spencer
Guest
Posts: n/a
 
      15th Nov 2005
HTTP is a TCP transport protocol. It is not a file system protocol. You
cannot use an HTTP url with IO classes. You can either use a file path or
UNC, or use a web client to get the file via HTTP.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
If you push something hard enough,
it will fall over.
- Fudd's First Law of Opposition

"Nico P." <(E-Mail Removed)> wrote in message
news:643B73F1-958C-4A50-86A4-(E-Mail Removed)...
>I already know these classes and I tried this:
>
> If System.IO.Directory.Exists("http://localhost/ACalcComponents/") Then
> Me.txtError.Text = "Yeah!"
> Else
> Me.txtError.Text = "D'oh!"
> End If
>
> the answer is "D'oh", although the directory exists. I don't really know
> how
> the path string should look like? I also tried it with
> "file:///localhost/ACalcComponents/" , but I also doesn't work. Can you
> please give me a small example of your solution?
>
>
> "Kevin Spencer" wrote:
>
>> System.IO.Directory
>> System.IO.DirectoryInfo
>> System.IO.File
>> System.IO.FileInfo
>>
>> --
>> HTH,
>>
>> Kevin Spencer
>> Microsoft MVP
>> ..Net Developer
>> If you push something hard enough,
>> it will fall over.
>> - Fudd's First Law of Opposition
>>
>> "Nico P." <(E-Mail Removed)> wrote in message
>> news:F7C3E898-29BF-4334-9980-(E-Mail Removed)...
>> > ok, here is my situation:
>> > I want to create an app that dynamically loads new components from a
>> > web
>> > server. to do that I have to read all files in a directory on the
>> > webserver.
>> > How can I do that?

>>
>>
>>



 
Reply With Quote
 
=?Utf-8?B?TmljbyBQLg==?=
Guest
Posts: n/a
 
      16th Nov 2005
ok, i can load the html file that contains the file list. But are there any
special classes to read data from an html file in .NET?
 
Reply With Quote
 
Kevin Spencer
Guest
Posts: n/a
 
      16th Nov 2005
An HTML file is pure text. What exactly do you mean by "read" it?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
If you push something hard enough,
it will fall over.
- Fudd's First Law of Opposition

"Nico P." <(E-Mail Removed)> wrote in message
news:71D3BBDB-484B-4E7B-B158-(E-Mail Removed)...
> ok, i can load the html file that contains the file list. But are there
> any
> special classes to read data from an html file in .NET?



 
Reply With Quote
 
=?Utf-8?B?TmljbyBQLg==?=
Guest
Posts: n/a
 
      16th Nov 2005
I mean something like the system.xml classes for xml documents, but for html,
so that I can easily get a list of all <A HREF...> tags in the document for
example. I just want to avoid to write an own parser if something like this
exists. but I haven't found anything yet...

"Kevin Spencer" wrote:

> An HTML file is pure text. What exactly do you mean by "read" it?
>
> --
> HTH,
>
> Kevin Spencer
> Microsoft MVP
> ..Net Developer
> If you push something hard enough,
> it will fall over.
> - Fudd's First Law of Opposition
>
> "Nico P." <(E-Mail Removed)> wrote in message
> news:71D3BBDB-484B-4E7B-B158-(E-Mail Removed)...
> > ok, i can load the html file that contains the file list. But are there
> > any
> > special classes to read data from an html file in .NET?

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Best way to read from directory with many files nickdu Microsoft Dot NET Framework 3 26th Feb 2009 08:35 AM
Program Files directory read-only mcp6453 Microsoft Windows 2000 3 9th Jun 2006 02:53 PM
Program Files directory read-only mcp6453 Microsoft Windows 2000 File System 3 9th Jun 2006 02:53 PM
read all the files after choosing a directory M H Microsoft Excel Programming 5 11th Jul 2005 04:14 AM
c# delete directory containing read only files =?Utf-8?B?Z2w=?= Microsoft C# .NET 6 18th May 2005 02:31 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:14 PM.