I am trying to first list all the IIS websites and the folders/virtual web directories in each (in a tree view). Then after that I would like to allow the user to select any of the above nodes and create a new virtual web directory there. I can create a virtual web directory if I know the path I plan to use but I cannot get a list of the folders/virtual web directories in a website (I can get the website list).
views:
485answers:
1
Q:
How do I list and create all IIS websites, folders in the websites and virtual web directories in C#
+2
A:
Use System.DirectoryServices to get the web sites from the IIS. You can find similar discussion at the following URL
http://channel9.msdn.com/forums/TechOff/78084-Extracting-list-of-web-sites-from-IIS-manager/
schar
2009-03-23 20:41:00
I can get the list of websites. Thanks though.
Greg
2009-03-24 05:26:14