DirectoryEntry.Exists(String) DirectoryEntry.Exists(String) DirectoryEntry.Exists(String) DirectoryEntry.Exists(String) Method

Definición

Determina si la ruta de acceso especificada representa una entrada real en el servicio de directorio.Determines if the specified path represents an actual entry in the directory service.

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

Parámetros

path
String String String String

Ruta de acceso de la entrada que se va a comprobar.The path of the entry to verify.

Devoluciones

Es true si la ruta de acceso especificada representa una entrada válida en el servicio de directorio; de lo contrario, es false.true if the specified path represents a valid entry in the directory service; otherwise, false.

Ejemplos

El ejemplo siguiente se toma un argumento y determina si la ruta de acceso corresponde a una DirectoryEntry.The following example takes one argument and determines whether the path corresponds to a valid 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);  
}  

Se aplica a