Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / February 2007

Tip: Looking for answers? Try searching our database.

How to get the application path :S

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Developer.Man4@gmail.com - 05 Feb 2007 12:56 GMT
Dear friends :)

i need a hand guys

i'm implementing a small program to list all virtual directories to
the user and give him some facilities to move or delete these files,
fine??

i can easily retrieve the list of all virtual directories using the
code below
System.DirectoryServices.DirectoryEntry iISAdmin = new
System.DirectoryServices.DirectoryEntry("IIS://localhost/W3SVC/1/
root");

then where is the problem, thats a good question :)
my problem that i've been facing for 3 days now, or even more, is that
how can i get the physical or actual path of the virtual path returned
from the code snippet above.

for example i get from the above piece of code "IIS://localhost/W3SVC/
1/root/Webapplication1"
but i can't send this path as an argument to File.move() or
File.delete(), i get a not supported format exception

what am i using, thats another good question :) :), i'm using VS2003,
c# IIS6
P.S. this program i'm trying to develop is a desktop application and
not a web application for security wise.

Thank you all and waiting eagerly for ur replies
Patrick Steele - 06 Feb 2007 02:57 GMT
> i'm implementing a small program to list all virtual directories to
> the user and give him some facilities to move or delete these files,
[quoted text clipped - 10 lines]
> how can i get the physical or actual path of the virtual path returned
> from the code snippet above.

string path = iISAdmin.Properties["Path"].Value.ToString();

Signature

Patrick Steele
http://weblogs.asp.net/psteele

Developer.Man4@gmail.com - 06 Feb 2007 08:02 GMT
Thanks patrick for the gr8 help :)

butr when i try it i get System.Reflection.TargetInvocationException
any ideas why and how to solve it??

> In article <1170680202.777209.21...@j27g2000cwj.googlegroups.com>,
> Developer.M...@gmail.com says...
[quoted text clipped - 18 lines]
> --
> Patrick Steelehttp://weblogs.asp.net/psteele
Developer.Man4@gmail.com - 06 Feb 2007 08:03 GMT
thanks patrick for the great help :D
but when i try this it i get
System.Reflection.TargetInvocationException

any ideas why and how to solve it??

> In article <1170680202.777209.21...@j27g2000cwj.googlegroups.com>,
> Developer.M...@gmail.com says...
[quoted text clipped - 18 lines]
> --
> Patrick Steelehttp://weblogs.asp.net/psteele
Patrick Steele - 06 Feb 2007 12:30 GMT
> thanks patrick for the great help :D
> but when i try this it i get
> System.Reflection.TargetInvocationException
>
> any ideas why and how to solve it??

Hmmmm... I just started with your code and dug around to find the
Properties collection and what was in it.  What's the InnerException of
the TargetInvocationException?

Signature

Patrick Steele
http://weblogs.asp.net/psteele

eng.rana - 07 Feb 2007 11:23 GMT
actually i found that it throws this exception because the local path
is not stored in the properties of the application its self under iis.
ratherthan having the full path /theapplicationname is stored, thus
the hresult of the request is not defined and hence it throws this
exception

> In article <1170749017.322006.221...@v33g2000cwv.googlegroups.com>,
> Developer.M...@gmail.com says...
[quoted text clipped - 11 lines]
> --
> Patrick Steelehttp://weblogs.asp.net/pstee

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.