473,394 Members | 1,701 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Virtual Directory Detection

Anyone know how I can programatically detect whether a virtual directory
exists on a machine my app is running on? And how to retrieve information
about that virtual directory?

Thanks very much. Amos.

Jan 13 '06 #1
2 2036
Amos,
You would need to read from the IIS Metabase on the machine for this. See the

System.DirectoryServices namespace, and you would use a path like
@"IIS://localhost/W3SVC/1/ROOT/Dir1/";

--etc.

Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Amos Soma" wrote:
Anyone know how I can programatically detect whether a virtual directory
exists on a machine my app is running on? And how to retrieve information
about that virtual directory?

Thanks very much. Amos.


Jan 13 '06 #2
Peter,

Thanks very much. This works. One additional item I need to find out is the
directory the virtual directory in question points to. I cannot seem to
determine how to get this.

For example, I have the following C# code. It correctly finds the
'MyVirtualDirectory' virtual directory. Now, what method do I call to
determine what folder 'MyVirtualDirectory' points to?

DirectoryEntry virtualDirectory = new
System.DirectoryServices.DirectoryEntry("IIS://localhost/W3SVC/1/Root/MyVirtualDirectory");

"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.com> wrote in message
news:C5**********************************@microsof t.com...
Amos,
You would need to read from the IIS Metabase on the machine for this. See
the

System.DirectoryServices namespace, and you would use a path like
@"IIS://localhost/W3SVC/1/ROOT/Dir1/";

--etc.

Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Amos Soma" wrote:
Anyone know how I can programatically detect whether a virtual directory
exists on a machine my app is running on? And how to retrieve information
about that virtual directory?

Thanks very much. Amos.


Jan 13 '06 #3

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

Similar topics

3
by: Zenobia | last post by:
I copy an application to wwwroot: wwwroot +--- myApp +--- common | +--- images | default.asp global.asa
2
by: Jeffry van de Vuurst | last post by:
Hi, (sorry for the crosspost, I wasn't sure which was the best place to put this). I was just thinking about something and wondered if any of you has some ideas about this. I'm using the...
5
by: Leszek | last post by:
Hello, Could anybody explain what's a difference between a virtual directory and an application root under IIS? I'm a little bit confused. This is mu problem: Let's assume the following...
2
by: Danny Miller | last post by:
Hi there, I'm facing a problem that is driving me nuts. The scenario is as follows: 1) Create an empty directory structure e.g. C:\Dev1\TestWebApp 2) Map a virtual directory e.g. TestWebApp...
4
by: david | last post by:
I basically use the following code to display the directory and file names in the WWWROOT, but can not show the virtual directory. ---- Dim path As String = Server.MapPath(x) Dim di As...
7
by: Amos Soma | last post by:
Thanks to Peter Bromberg for showing me how to detect if a virtual directory exists. Now I need to determine what folder the virtual directory points to. For example, I have the following C#...
8
by: wally | last post by:
There is a brilliant application that allows you to wrap your EXE and all associated DLLs, OCXs, etc. into a single executable and run the executable on Windows OSs with no install and nor...
6
by: ManagedCoder | last post by:
Hi, My requirement is as follows: I need to set the HttpExpires (enable content expiration - set to 7 days) on a folder within a virtual directory. I have been able to set the HttpExpires...
6
by: Scott M. | last post by:
I didn't get a resolution to this in my earlier post, so I'll try again: System: Windows XP Pro. (SP2) with IIS installed and running PRIOR to VS 2008 Pro. installation. VS 2008 Pro. (full...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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...
0
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
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...

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.