Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need External Function To get the system Password(PowerBuilder 7.0.2)

Status
Not open for further replies.

PowerBuilderProgram

IS-IT--Management
Mar 11, 2009
1
0
0
US
hi,
Previously we had login system where we give user name and
password,but now we are chaging that PowerBuilder Application should
take the System UserName and PassWord,
So please can any one say what is the external function used to get
the system password.I do not have option to retieve fromn the registry
ediitor,

With Regards,
Naren Nunna

 
I use PB 10.5 but I think that my code should work for you.

To get Windows user name you should:

1. declare external function:
Function boolean GetUserName( ref string buffer, ref ulong buflen ) Library "advapi32.dll" Alias For "GetUserNameW"

2. Read user name:
ULong lul_buflen=255
String ls_winusername

ls_winusername = Space(255)
IF NOT GetUserName(ls_winusername, lul_buflen) THEN
ls_winusername = "User unknown"
END IF

Tomek
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top