Csharp/CSharp Tutorial/Directory Services/Host — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
Admin (обсуждение | вклад) м (1 версия) |
(нет различий)
|
Текущая версия на 15:20, 26 мая 2010
List virtual hosts
<source lang="csharp">using System; using System.Data; using System.DirectoryServices; public class MainClass{
public static void Main() { DirectoryEntry directoryEntry1 = new DirectoryEntry(); directoryEntry1.Path = "IIS://localhost/W3SVC/1/ROOT"; foreach( DirectoryEntry entry in directoryEntry1.Children ) { if ( entry.SchemaClassName == "IIsWebVirtualDir" ) { //Console.WriteLine( entry.Name ); Console.WriteLine( entry.Properties[ "Path" ].Value ); } } }
}</source>