Why don't you just try catch around it? If it's valid, then it won't throw
an exception, if it's invalid then it will and you can deal with it in the
catch block.
Josh Moody
VSU Team
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
Note: For the benefit of the community-at-large, all responses to this
message are best directed to the newsgroup/thread from which they
originated.
--------------------
Content-Class: urn:content-classes:message
From: "MJ" <an*******@discussions.microsoft.com>
Sender: "MJ" <an*******@discussions.microsoft.com>
Subject: Urgent- Authentication with Active Directory
Date: Fri, 9 Jan 2004 12:19:01 -0800
Lines: 25
Message-ID: <03****************************@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Thread-Index: AcPW7dHJA0xlfVtnT92p3+U1IJstjw==
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Newsgroups: microsoft.public.dotnet.languages.vb
Path: cpmsftngxa07.phx.gbl
Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.languages.vb:171614
NNTP-Posting-Host: tk2msftngxa09.phx.gbl 10.40.1.161
X-Tomcat-NG: microsoft.public.dotnet.languages.vb
Hi,
I'm trying to authenticate a user by creating a
DirectoryEntry using the contructor with signature
Dim objEntry = New DirectoryEntry(path, username, pwd).
and then i check for
If Not objEntry is Nothing then ... to continue processing
When a correct username/pwd is passed, everything works
fine. The problem is when an Invalid Username/pwd is
supplied.
objEntry is returned as an object so well it's
not 'Nothing'. Trying to access the underlying
NativeObject results in an exception. There are private
properties(Bound) and methods (adsobject) which could be
of help but since they are private, they cannot be
accessed. Could somebody please help me with how I could
check if the DirectoryEntry object returned is truly
bound and valid?
Thanks,
MJ