Getting the User’s Last Name in Windows 10 Apps using JavaScript

Published on June 14, 2015 by abundantcode

Filed under JavaScript

Last modified June 14, 2015

Print this page

rate 1 star rate 2 star rate 3 star rate 4 star rate 5 star
Your rating: none, Average: 0 (0 votes)

This article have been viewed 3476 times

Below is a sample JavaScript code snippet demonstrating how to get the user’s last Name from the Windows 10 Universal Windows Platform App using WinJS.

How to Get the User’s last Name in Windows 10 Apps using JavaScript ?

function getUserlastNameAC() {
    if (Windows.System.UserProfile.UserInformation.nameAccessAllowed) {
        Windows.System.UserProfile.UserInformation.getLastNameAsync().done(function (data) {
            if (data) {
               return data;
            } 
        });
    } else {
        return "Last Name cannot be accessed because this functionality is disabled by Privacy Setting or Group Policy in Windows 10";
    }
}
If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

Leave a Comment


x

You might be Interested in these Posts

ES6: The future is now at Warrington on October 18 , 2016

JavaScript North West User Group is hosting its user group meet on the topic "ES6: The future i...

How to delete user account from command line in Windows 10 ?

You can delete a user account from command line in Windows 10 using the net user command and specify...

How to add new user account from command line in Windows 10 ?

You can add a new user account in Windows 10 using command prompt using the net user command and pas...