DirectoryEntry.Exists(String) 메서드

정의

지정된 경로가 디렉터리 서비스의 실제 항목을 나타내는지 여부를 확인합니다.

public:
 static bool Exists(System::String ^ path);
public static bool Exists(string path);
static member Exists : string -> bool
Public Shared Function Exists (path As String) As Boolean

매개 변수

path
String

확인할 항목의 경로입니다.

반품

true지정된 경로가 디렉터리 서비스의 유효한 항목을 나타내는 경우 그렇지 않으면 . false

예제

다음 예제에서는 하나의 인수를 사용하여 경로가 유효한 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);
}

적용 대상