Wrox Programmer Forums
|
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 May 9th, 2007, 09:35 AM
Friend of Wrox
 
Join Date: Aug 2004
Posts: 550
Thanks: 0
Thanked 1 Time in 1 Post
Default Directory access

Hi Friends

I am trying to show the contents of my C: drive in the form of windows explorer, I can do that on my machine coz I get the physical path c: here like

  DirectoryInfo dirs = new DirectoryInfo("C:\")

But what if I have to access a particular directory of the server where my application is deployed. e.g. D:/Project folder of the server..

Is it possible?

Regards
Mike

Fortune favours the brave, so don't regret on missed oppurtunities.
__________________
Regards
Mike
 
Old May 9th, 2007, 10:03 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

this might work for you mike:
http://msdn2.microsoft.com/en-us/library/ms178116.aspx

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
 
Old May 9th, 2007, 10:12 AM
Friend of Wrox
 
Join Date: Aug 2004
Posts: 550
Thanks: 0
Thanked 1 Time in 1 Post
Default

Thanx parsons for the doc, but I guess it explains all that we know, general methods, server.mapath, ApplicationPath etc. What I was interested was to access the folders and files of say D: Drive or E: drive of the machine where my application is deployed, not the folder or root where my application is deployed. Hope you can understand my issue.

Regards
Mike

Fortune favours the brave, so don't regret on missed oppurtunities.
 
Old May 9th, 2007, 10:18 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Yes you can do this, although it is going to require that the asp.net account has the necessary permissions to those drives/folders/files.

For example I can do:
DirectoryInfo dirs = new DirectoryInfo("C:\\");
Response.Write(Convert.ToString(dirs.LastAccessTim e));

Which will return me the last access time of my C Drive from a web application.

hth.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========





Similar Threads
Thread Thread Starter Forum Replies Last Post
Linking Access to Active Directory Brendan Bartley Access 2 November 28th, 2007 05:42 AM
Active Directory Access obrienkev C# 2005 3 October 31st, 2007 11:36 AM
Access to Active Directory pcyoung Access 4 August 17th, 2007 08:32 AM
File Directory Access ra7207 VB.NET 1 June 20th, 2006 01:45 PM
Access denied to a directory hasanali00 BOOK: ASP.NET Website Programming Problem-Design-Solution 2 March 22nd, 2005 07:35 AM





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