DirectoryEntry.Exists メソッド
アセンブリ: System.DirectoryServices (system.directoryservices.dll 内)

Dim path As String Dim returnValue As Boolean returnValue = DirectoryEntry.Exists(path)
戻り値
指定したパスがディレクトリ サービスの有効なエントリを表している場合は true。それ以外の場合は false。

1 つの引数を受け取り、有効な DirectoryEntry に対応するパスかどうかを調べる例を次に示します。
Dim myADSPath As String = "LDAP://onecity/CN=Users,DC=onecity,DC=corp,DC=fabrikam,DC=com" ' Determine whether the given path is correct for the DirectoryEntry. If DirectoryEntry.Exists(myADSPath) Then Console.WriteLine("The path {0} is valid",myADSPath) Else Console.WriteLine("The path {0} is invalid",myADSPath) End If
string myADSPath ="LDAP://onecity/CN=Users,DC=onecity ,DC=corp,DC=fabrikam,DC=com"; // Determine whether the given path is correct for the DirectoryEntry. if (DirectoryEntry.Exists(myADSPath)) { Console.WriteLine("The path {0} is valid",myADSPath); } else { Console.WriteLine("The path {0} is invalid",myADSPath); }
String^ myADSPath = "LDAP://onecity/CN=Users,DC=onecity,DC=corp ,DC=fabrikam,DC=com"; // Determine whether the given path is correct for the DirectoryEntry. if (DirectoryEntry::Exists(myADSPath)) { Console::WriteLine("The path {0} is valid", myADSPath); } else { Console::WriteLine("The path {0} is invalid", myADSPath); }

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- DirectoryEntry.Exists メソッドのページへのリンク