DirectoryEntry.Exists(String) 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
지정된 경로가 디렉터리 서비스의 실제 항목을 나타내는지 여부를 확인합니다.
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);
}