cancel
Showing results for 
Search instead for 
Did you mean: 

To get system login username and password in a variable

Former Member
0 Kudos

I am using powerbuilder emailsmtp program to send the email  from powerbuilder application 11.2, But each machine have separate user name and password  for each user email. That user name password is same as system login username and login password. Is there anyway to get this username, password  in session variable to send the mail automatically from the program without manually giving  loginname and password while sending the mail.

Please advise

Kind Regards

Pol

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Polachan;

   The user & login name is easy to get via the GetUserName or GetUserNameEx MS-Windows SDK calls.

FUNCTION Boolean GetUserName (ref string lpBuffer, ref Long nSize ) LIBRARY "ADVAPI32.DLL" ALIAS FOR "GetUserNameW"

   The password is not obtainable though (AFAIK). However, you could circumvent that by using Active Directory (trusted) access. You would have to use the ADSI MS-Windows API calls for that.

FYI:  Active Directory Service Interfaces (Windows)

HTH

Regards ... Chris

Former Member
0 Kudos

Please Can you provide a sample program using that API

Regards

Pol

Former Member
0 Kudos

Hi Polachan;

  FYI: All the above things are implemented in my STD Foundation Classes for PB & Appeon (aka "Integrated Framework").

Regards ... Chris

Former Member
former_member190719
Active Contributor
0 Kudos

You can find samples of using LDAP to work with Active Directory on the old Sybase CodeXchange site:  http://www.sybase.com/detail?id=1058501&id=1058501

Answers (0)