Get user profile information

Visual Basic tutorials for UWP apps.
3 posts Page 1 of 1
Contributors
User avatar
CodenStuff
Site Admin
Site Admin
Posts: 4389
Joined: Tue Aug 04, 2009 1:47 am

Get user profile information
CodenStuff
The following will allow you to get and use the logged in users profile information for use in a metro app.

Get the users display name:
Code: Select all
Windows.System.UserProfile.UserInformation.DisplayName
Get the users first name:
Code: Select all
Windows.System.UserProfile.UserInformation.FirstName
Get the users last name:
Code: Select all
Windows.System.UserProfile.UserInformation.LastName
Get the users profile picture:
Code: Select all
Dim ProfilePicture As StorageFile = Windows.System.UserProfile.UserInformation.GetAccountPicture(Windows.System.UserProfile.AccountPictureKind.SmallImage)
        Dim PictureStream As IRandomAccessStream = Await ProfilePicture.OpenReadAsync()
        Dim BitmapImage As BitmapImage = New BitmapImage()
        BitmapImage.SetSource(PictureStream)
        ImageControl.Source = BitmapImage
Change "ImageControl" to the name of the control you wish to display the image inside. You can also change ".SmallImage" to ".LargeImage" to get a larger version of the profile picture.
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
User avatar
Usman55
VIP - Site Partner
VIP - Site Partner
Posts: 2821
Joined: Thu Dec 24, 2009 7:52 pm

Re: Get user profile information
Usman55
Can you tell us where you got all this info? I'm excited about it.
Image
User avatar
Dummy1912
VIP - Donator
VIP - Donator
Posts: 1969
Joined: Sat Aug 21, 2010 2:17 pm

Re: Get user profile information
Dummy1912
:lol: nice

to bad i haven't win8
but i known you can do the same thingy in other windows.
okay maybe not the same 100% code but just enough
to get that part :)
visit us on:


http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
3 posts Page 1 of 1
Return to “Visual Basic”