Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 11th, 2006, 06:06 AM
Friend of Wrox
Points: 1,935, Level: 17
Points: 1,935, Level: 17 Points: 1,935, Level: 17 Points: 1,935, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2004
Location: United Kingdom
Posts: 550
Thanks: 0
Thanked 1 Time in 1 Post
Default Accessing Directory

Hi friends,

let me wrap it quickly with an example, suppose I am adding a new page in wrox website, that page will look for images folder in another website say www.abc.com which has given read,write permissions on that images folder, IS IT POSSIBLE TO READ THE IMAGES INSIDE THAT FOLDER WITHOUT KNOWING THE ACTUAL PHYSICAL PATH, I know only the URI, i.e. http://www.abc.com/images

Regards
Mike
__________________
Regards
Mike
 
Old October 11th, 2006, 06:36 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Is the directory your trying to read from on your server or another server outside your domain? In the latter of the cases, no your not going to be able to hit a remote box and iterate through a directory.

If however it is on a server inside your domain, given the URI, you can make the general assumption that the folder 'images' exists in the root folder of the web application so you could use the System.IO.DirectoryInfo to loop through the directory. Just do Server.MapPath("./images/")

hth.

--Stole this from a moderator

I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
 
Old October 11th, 2006, 09:14 AM
Friend of Wrox
Points: 1,935, Level: 17
Points: 1,935, Level: 17 Points: 1,935, Level: 17 Points: 1,935, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2004
Location: United Kingdom
Posts: 550
Thanks: 0
Thanked 1 Time in 1 Post
Default

Ya dparsons

I know that within a domain we can access the folder, but I am asking from a different domain. Isin't there any other technique?

Regards
Mike
 
Old October 11th, 2006, 09:20 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

If you are saying can you go over HTTP and iterate through the contents of a remote directory, no. You would need some sort of physical access to the server.

--Stole this from a moderator

I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
 
Old October 11th, 2006, 09:42 AM
Friend of Wrox
Points: 1,935, Level: 17
Points: 1,935, Level: 17 Points: 1,935, Level: 17 Points: 1,935, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2004
Location: United Kingdom
Posts: 550
Thanks: 0
Thanked 1 Time in 1 Post
Default

Yup

I know it was not possible to iterate through HTTP, was just trying my luck here, thanx anyways

Regards
Mike
 
Old October 13th, 2006, 03:10 AM
Friend of Wrox
Points: 1,935, Level: 17
Points: 1,935, Level: 17 Points: 1,935, Level: 17 Points: 1,935, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2004
Location: United Kingdom
Posts: 550
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hey Parsons

Suppose I know the IP address of that website, is there any way through socket programming that I can access the folder on that server. Actually its a bit urgent, so trying out all the methods (though I know its a bit difficult)

Regards
Mike
 
Old October 13th, 2006, 06:35 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Since this is a remote machine outside of your network I am not sure how you will accomplish this; I think you may have some luck using RDP (Remote Desktop Protocol) to connect to the remote machine and enumerate the directory structure that way but even then you do not know where on that server the directory is located that you want to enumerate, all you know is the virtual directory.

Most companies move the inetpub directory off of the system root drive as a secruity percaution so you cant make the assumption that the directory existst as %systemroot%\inetpub\wwwroot\dir\dir

Not sure how you will accomplish this.

-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.

^^Thats my signature




Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing a Local Directory stonesbg ASP.NET 2.0 Basics 8 January 12th, 2007 06:39 PM
Accessing MaxPwdAge in Active Directory using .net chandu80 General .NET 0 June 4th, 2005 01:04 AM
Directory in C# raviprakash_7 C# 1 April 11th, 2005 10:33 AM
Accessing a WS in a password protected directory FleaBite .NET Web Services 3 July 6th, 2004 09:44 AM
how to get sub Directory ngthhoang Visual C++ 0 November 22nd, 2003 09:51 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.