473,503 Members | 1,804 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Get directory listing from a web server

Hello all, how do I get a directory listing from a web server ?, I'm
playing around with reflection and "Click once" deployment and would
like to loop through a directory listing and use Assembly.LoadFrom(dllname)

many thanks
Apr 7 '06 #1
6 5698
Hi,

You could use Directory.GetFiles . IIRC you cannot use reflection for this,
you have to use Server.MapPath to get hte physical path.
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Pete Kane" <pj**********@uku.co.uk> wrote in message
news:oy*****************@newsfe6-win.ntli.net...
Hello all, how do I get a directory listing from a web server ?, I'm
playing around with reflection and "Click once" deployment and would like
to loop through a directory listing and use Assembly.LoadFrom(dllname)

many thanks

Apr 7 '06 #2
Ignacio Machin ( .NET/ C# MVP ) wrote:
Hi,

You could use Directory.GetFiles . IIRC you cannot use reflection for this,
you have to use Server.MapPath to get hte physical path.

Hello Ignacio, thanks for your reply, I take it Directory.GetFiles takes
a web addresss as a parameter ?

cheers
Apr 7 '06 #3
Ignacio Machin ( .NET/ C# MVP ) wrote:
Hi,

You could use Directory.GetFiles . IIRC you cannot use reflection for this,
you have to use Server.MapPath to get hte physical path.

Just thought I would clarify the way I'm trying to retrieve this
directory listing, I'm not using Asp, my app is a Windows form app
which loads all needed assemblies from a remote web site, the way I do
it now is:

string f1 = "mydll1.dll";
string f2 = "mydll2.dll";
....
string url = @"http://mywebsite.com/Assemblies/";

Assembly.LoadFrom(url + f1)
....
etc...
which is horrible but it works, I would like to read all the files
directly and loop through them

thanks
Apr 7 '06 #4
Hi,

"Pete Kane" <pj**********@uku.co.uk> wrote in message
news:VT*****************@newsfe6-gui.ntli.net...
Ignacio Machin ( .NET/ C# MVP ) wrote:
Hi,

You could use Directory.GetFiles . IIRC you cannot use reflection for
this, you have to use Server.MapPath to get hte physical path.

Hello Ignacio, thanks for your reply, I take it Directory.GetFiles takes a
web addresss as a parameter ?


Nop, it takes a local path , that's why you need MapPath for.
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
Apr 7 '06 #5

Pete Kane wrote:
Ignacio Machin ( .NET/ C# MVP ) wrote:
Hi,

You could use Directory.GetFiles . IIRC you cannot use reflection for this,
you have to use Server.MapPath to get hte physical path.

Just thought I would clarify the way I'm trying to retrieve this
directory listing, I'm not using Asp, my app is a Windows form app
which loads all needed assemblies from a remote web site, the way I do
it now is:

string f1 = "mydll1.dll";
string f2 = "mydll2.dll";
...
string url = @"http://mywebsite.com/Assemblies/";

Assembly.LoadFrom(url + f1)
...
etc...
which is horrible but it works, I would like to read all the files
directly and loop through them


Most (all?) production web servers disable the ability to browse a
directory content from a web client, for obvious security reasons, so
you're basically out of luck on this one. Can't you create and maintain
a known HTML page (or even plain text file) that contains the list of
your plugins?

Arnaud
MVP - VC

Apr 7 '06 #6
ad******@club-internet.fr wrote:
Pete Kane wrote:
Ignacio Machin ( .NET/ C# MVP ) wrote:
Hi,

You could use Directory.GetFiles . IIRC you cannot use reflection for this,
you have to use Server.MapPath to get hte physical path.


Just thought I would clarify the way I'm trying to retrieve this
directory listing, I'm not using Asp, my app is a Windows form app
which loads all needed assemblies from a remote web site, the way I do
it now is:

string f1 = "mydll1.dll";
string f2 = "mydll2.dll";
...
string url = @"http://mywebsite.com/Assemblies/";

Assembly.LoadFrom(url + f1)
...
etc...
which is horrible but it works, I would like to read all the files
directly and loop through them

Most (all?) production web servers disable the ability to browse a
directory content from a web client, for obvious security reasons, so
you're basically out of luck on this one. Can't you create and maintain
a known HTML page (or even plain text file) that contains the list of
your plugins?

Arnaud
MVP - VC

Looks like I'll have to go that route, thanks all, BTW is MapPath an asp
function ?

regards

Apr 8 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1590
by: Dan King | last post by:
I have an ASP page that currently gives me an output of file listing with links to each of them for the current directory. The problem I am having is there are getting to be too many folders. I...
2
17626
by: Dean | last post by:
Hi I've got a question relating to using Javascript on an Intranet. I have a directory with a list of files in the format week36.xls, week37.xls and I want to write a script that will scan...
19
3290
by: SU News Server | last post by:
I've struggled with this for quite a while and I'm am just not sure what is going on. I have the following code import os def buildList( directory='/Users/mkonrad' ) dirs = listing =...
5
2475
by: Michael C | last post by:
....on a remote machine? Thanks, Michael C.
8
11054
by: gil | last post by:
Is it possible to prevent a browser from listing the entire contents of a folder? The site, is hosted on my ISP with the following layout- site/ "user name from ISP" pagefile (dir)...
8
6934
by: dougawells | last post by:
Hi - I'm hoping for help with the auto-generation of a hyperlinked listing of all files in a directory. The server I use does not auto-generate this. So, when someone comes to this directory and...
7
5466
by: epikto | last post by:
I have a mapped share that I am trying to get a listing of all the files that it contains. I use the following code to access the contents String files = Directory.GetFiles(path); I can then...
2
2511
by: marcusadeleon | last post by:
Hi, I was wondering how to open up a web directory to get a file listing. The directory I want to open allows directory listings, but has a directory password. Meaning it gives me a prompt to...
1
5638
by: Steve | last post by:
My site is hosted on a Godaddy reseller site. Godaddy only allows the use of Curl to access remote sites. What is the method for listing a directory after connecting to the site with Curl? ...
0
7076
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7274
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7323
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6984
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
7453
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
5576
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,...
1
5005
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3151
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
377
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.