The most reliable way to retrieve this kind of info is by calling Windows functions.
The API function GetUserName does the trick.
Please give the following code a try:
program-id. prg.
working-storage section.
77 userName pic x(32).
77 len pic 99 value 32.
procedure division.
main.
call client "C$SETENV" using "dll_convention", "1".
call client "GetUserNameA" using by reference userName
by reference len
on exception
call client "ADVAPI32.dll"
call client "GetUserNameA" using by reference userName
by reference len
end-call.
display userName.
goback.
Authored
by: Veryant Support
This question has been viewed 4417 times so far.
Click
Here to View all the questions in AS - Application Server
category.
File Attachments
There are no attachment file(s) related to this question.
User Comments
There are no user comments for this question. Be the first to post a comment. Click Here