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);  
}  
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);  
}  

적용 대상