Home All Groups Group Topic Archive Search About

Retreive windows Logged in UserName and Password

Author
13 Jan 2006 9:23 AM
Sudhakara.T.P.
Hi,
I have an application in VB.NET windows application, wherein the
administrator has the option to change the authentication mode ie., whether
the application should work as a normal database authentication or the
windows based authentication mode.
If the administrator sets the application authentication mode to windows
based, then the application has to verify the windows logged in username and
password and then allow the user to use the application. I am not able to
retreive the windows logged in UserName and Password in VB.NET. In VB 6.0, I
am able to retreive the windows logged in UserName but not the password.
Can anyone help me in this.
Thanks
Sudhakara.T.P.

Author
13 Jan 2006 11:53 AM
Carlos J. Quintero [VB MVP]
Hi,

To know the user you can use System.Environment.UserName. You can´t get the
password of the user for obvious reasons, but there are APIs (not sure if
managed APIs) to try to logon a user in a domain or to get if the user is
logged in a domain. See:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/secauthn/security/authentication_portal.asp

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio
You can code, design and document much faster:
http://www.mztools.com


Show quoteHide quote
"Sudhakara.T.P." <Sudhakar***@discussions.microsoft.com> escribió en el
mensaje news:632E28BA-3427-4938-8B16-520A611575DC@microsoft.com...
> Hi,
> I have an application in VB.NET windows application, wherein the
> administrator has the option to change the authentication mode ie.,
> whether
> the application should work as a normal database authentication or the
> windows based authentication mode.
> If the administrator sets the application authentication mode to windows
> based, then the application has to verify the windows logged in username
> and
> password and then allow the user to use the application. I am not able to
> retreive the windows logged in UserName and Password in VB.NET. In VB 6.0,
> I
> am able to retreive the windows logged in UserName but not the password.
> Can anyone help me in this.
> Thanks
> Sudhakara.T.P.