how to pass nt password ?



I succesfully pass username , domain and password via this function (taken
from MSDN)

Private Declare Auto Function LogonUser Lib "advapi32.dll" (ByVal
lpszUsername As [String], _

ByVal lpszDomain As [String], ByVal lpszPassword As [String], _

ByVal dwLogonType As Integer, ByVal dwLogonProvider As Integer, _

ByRef phToken As IntPtr) As Boolean

Dim returnValue As Boolean = LogonUser(username, domain, pwd,
LOGON32_LOGON_INTERACTIVE, LOGON32_PROVIDER_DEFAULT, tokenHandle)

The above assumes that in the application, user will be required to enter
username, domain and password via keyboard

However i do NOT want the application to ASK user for the username,domain
and password. Instead the application shld use the current user context
since users already logon to a operating system eg XP.

i can extract username and domain using the WindowsIdentity.Name Property
which give it as domain\nt id, and then i pass to above function in
username, domain.

How do i extract password ? I know password cannot be seen, but at least
what can i do to pass the current password arguments into the above
function - logonuser ?










.



Relevant Pages

  • Re: Date stamp user
    ... A re-read of your original shows you want computer name, not username. ... Dim ComputerName As String ... Private Sub Workbook_BeforeSave(ByVal SaveAsUI _ ... As Boolean, Cancel As Boolean) ...
    (microsoft.public.excel.misc)
  • Validating a username with a password using algorithms
    ... I want the username and password to be stored in an algorithm ... public boolean login() { ... userValid = validateUser; ...
    (comp.lang.java.help)
  • RE: msbuild : Message: Value cannot be null. Parameter name: type
    ... then copy the built files to the server i get the error when i run the ... Exception Details: System.ArgumentNullException: Value cannot be null. ... System.Activator.CreateInstance(Type type, Boolean nonPublic) ... System.Web.Profile.ProfileBase.CreateMyInstance(String username, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: User access his own records
    ... One approach would be to add code in the form's BeforeUpdate event that ... checks the user's UserName against what was stored for the row and cancels ... Enabled property to the boolean value. ... I have multi user database form where a record field takes automatically ...
    (microsoft.public.access.formscoding)
  • RE: msbuild : Message: Value cannot be null. Parameter name: type
    ... then copy the built files to the server i get the error when i run the ... Exception Details: System.ArgumentNullException: Value cannot be null. ... System.Activator.CreateInstance(Type type, Boolean nonPublic) ... System.Web.Profile.ProfileBase.CreateMyInstance(String username, ...
    (microsoft.public.dotnet.languages.csharp)

Loading