Username, Password

How can i get the USername and Password from the user currently logged in (WinNT/9X/2000)
snoopy_SpyAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
RadlerConnect With a Mentor Commented:
A complete example

function TNetMachine.GetUserName : string;
var
      Buf : array[0..2*MAX_COMPUTERNAME_LENGTH + 1] of char;
      Len : cardinal;
begin
      Len:=High(Buf);
      if Windows.GetUserName( Buf, Len ) then begin
            Result:=string(Buf);
      end else begin
            Result:=EmptyStr;
      end;
end;

T++, Radler.
0
 
AttarSoftwareCommented:
Use the api call:

GetUsername( nm : pChar ; var len : longint ) ;

To get the username...the password is a different matter...

Tim.
0
All Courses

From novice to tech pro — start learning today.