473,797 Members | 3,079 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.LoadFr om(dllname)

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

You could use Directory.GetFi les . 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**********@u ku.co.uk> wrote in message
news:oy******** *********@newsf e6-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.LoadFr om(dllname)

many thanks

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

You could use Directory.GetFi les . 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.GetFi les takes
a web addresss as a parameter ?

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

You could use Directory.GetFi les . 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.LoadFr om(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**********@u ku.co.uk> wrote in message
news:VT******** *********@newsf e6-gui.ntli.net...
Ignacio Machin ( .NET/ C# MVP ) wrote:
Hi,

You could use Directory.GetFi les . 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.GetFi les 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.GetFi les . 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.LoadFr om(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.GetFi les . 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.Load From(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
1598
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 currently have the ASP page copied into each folder and sub folder, but if I want to make a change, I have to change all the ASP files. Is there a way I can create either: Have a simple index.asp page that will reference and run my code in my...
2
17642
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 all the files in the directory and select the one with the highest week number then display in the browser window. A brief search hasn't revealed any code to do this so I just want to know if it is possible and what the function names are that...
19
3317
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 = os.listdir(directory)
5
2486
by: Michael C | last post by:
....on a remote machine? Thanks, Michael C.
8
11066
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) index.html site/pagefile/
8
6954
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 thus opens index.htm, I want that file to show a listing of all files in the directory with hyperlinks to them. Thanks for the help, Doug
7
5500
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 enumerate through that array to get my listing. However I am trying to set my application up as a service. And now (after calling methods in a thread using the OnStart() method) it says the directory does not exist (I verified this with a...
2
2536
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 put in a username and password when I go to the web address in internet explorer. Once I put in the correct username and password, it shows the directory listing.
1
5674
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? I've already tested my code for connecting but how do I list whats in the directory. The purpose is to compare the list to the filenames in my database.
0
9685
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9536
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10468
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10245
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10021
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6802
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5458
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3748
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2933
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.