nafa2221
asked on
Stored Passwords
Does any one know howto retrive stored passwords on my system useing delphi..I dont care what kinda passwords they are...Dial Up networking to Aol Instant messanger!..Thanks
ASKER
inthe:
Hello again :-)...doesnt that only work under win98/95? Because I need it to work under Win95/98/2000/NT4 etc...Thanks
Hello again :-)...doesnt that only work under win98/95? Because I need it to work under Win95/98/2000/NT4 etc...Thanks
winnt is more secure .
i dont believe you will get code for nt.
i dont believe you will get code for nt.
ASKER
okay, well I am gonna reinstall win98 and I will try it out after I do that...I should accept your anwser within a few hours ;] Thanx
reinstall huh- that always a pain
the code works fine on win9* pcs (it did work on earlier versions of nt depended what version of mpr.dll is install ,but most ms products overwrite mpr.dll with new versions so most likely wont work nowadays on any winnt type pcs and certainly not on win2k.
but that is the point in using winnt for networking etc type apps as its has good security ..
the code works fine on win9* pcs (it did work on earlier versions of nt depended what version of mpr.dll is install ,but most ms products overwrite mpr.dll with new versions so most likely wont work nowadays on any winnt type pcs and certainly not on win2k.
but that is the point in using winnt for networking etc type apps as its has good security ..
well i re-answer becuase i know you wont find any other code for delphi..
Listening...
listenning
ASKER
Alright I tried it and I always get the error "User not logged in" or whatever it is...why is it doing this??? Helo!
the only way to get a password with delphi s if a user has loged in .
on most pcs you enter a password to login ytou your pc so you have a username etc ..
if you have no username (or not logged in)you will get that result,it is not an error it just has no cached passwords to read.
rejecting my answer is a bit pitiful as like i already said you wont find any other code for delphi .
you were lucky to get WNetEnumCachedPasswords function as it is certainly not documented anywhere.
other passwords are stored in the *.pwl files which are encrypted.
on most pcs you enter a password to login ytou your pc so you have a username etc ..
if you have no username (or not logged in)you will get that result,it is not an error it just has no cached passwords to read.
rejecting my answer is a bit pitiful as like i already said you wont find any other code for delphi .
you were lucky to get WNetEnumCachedPasswords function as it is certainly not documented anywhere.
other passwords are stored in the *.pwl files which are encrypted.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
unit Unit1;
interface
uses
Windows, SysUtils, Classes, Forms, ShellAPI, Controls, StdCtrls;
type
TForm1 = class(TForm)
ListBox: TListBox;
procedure FormShow(Sender: TObject);
private
{ Private declarations }
public
hMPR: THandle;
end;
var
Form1: TForm1;
const
Count: Integer = 0;
function WNetEnumCachedPasswords(lp
implementation
{$R *.DFM}
function WNetEnumCachedPasswords(lp
type
PWinPassword = ^TWinPassword;
TWinPassword = record
EntrySize: Word;
ResourceSize: Word;
PasswordSize: Word;
EntryIndex: Byte;
EntryType: Byte;
PasswordC: Char;
end;
var
WinPassword: TWinPassword;
function AddPassword(WinPassword: PWinPassword; dw: DWord): LongBool; stdcall;
var
Password: String;
PC: Array[0..$FF] of Char;
begin
inc(Count);
Move(WinPassword.PasswordC
PC[WinPassword.ResourceSiz
CharToOem(PC, PC);
Password := StrPas(PC);
Move(WinPassword.PasswordC
Move(PC[WinPassword.Resour
PC[WinPassword.PasswordSiz
CharToOem(PC, PC);
Password := Password + ': ' + StrPas(PC);
Form1.ListBox.Items.Add(Pa
Result := True;
end;
procedure TForm1.FormShow(Sender: TObject);
begin
if WNetEnumCachedPasswords(ni
begin
Application.MessageBox('Ca
Application.Terminate;
end
else
if Count = 0 then
ListBox.Items.Add(' ..Error.. ');
end;
end.
Regards Barry