MyPage is a personalized page based on your interests.The page is customized to help you to find content that matters you the most.


I'm not curious

Get Windows username - PowerBuilder

Published on 03 September 16
1740
0
1
//Create a local external function
Function boolean GetUserName( ref string buffer, ref ulong buflen ) Library "advapi32.dll" Alias For "GetUserNameW"
//Write the below code to get the windows username
//You can associate the code to MessageBox / single line edit's text
// Here I am displaying the winusername in text box
// Object :: button
// event clicked
// display username in sle_1

ULong lul_buffer=100
String ls_winusr

ls_winusr = Space(100)
IF NOT GetUserName(ls_winusr, lul_buffer) THEN
ls_winusr = "User unknown"
END IF

sle_1.text=ls_winusr
Get Windows username - PowerBuilder - Image 1
//Create a local external function

Function boolean GetUserName( ref string buffer, ref ulong buflen ) Library "advapi32.dll" Alias For "GetUserNameW"

//Write the below code to get the windows username//You can associate the code to MessageBox / single line edit's text

// Here I am displaying the winusername in text box

// Object :: button

// event clicked

// display username in sle_1

ULong lul_buffer=100

String ls_winusr

ls_winusr = Space(100)

IF NOT GetUserName(ls_winusr, lul_buffer) THEN

ls_winusr = "User unknown"

END IF

sle_1.text=ls_winusr

Get Windows username - PowerBuilder - Image 1

This blog is listed under Development & Implementations Community

Related Posts:
Post a Comment

Please notify me the replies via email.

Important:
  • We hope the conversations that take place on MyTechLogy.com will be constructive and thought-provoking.
  • To ensure the quality of the discussion, our moderators may review/edit the comments for clarity and relevance.
  • Comments that are promotional, mean-spirited, or off-topic may be deleted per the moderators' judgment.
You may also be interested in
 
Awards & Accolades for MyTechLogy
Winner of
REDHERRING
Top 100 Asia
Finalist at SiTF Awards 2014 under the category Best Social & Community Product
Finalist at HR Vendor of the Year 2015 Awards under the category Best Learning Management System
Finalist at HR Vendor of the Year 2015 Awards under the category Best Talent Management Software
Hidden Image Url

Back to Top