locked
Windows Store Applications to retrieve UserALias of Logged in user

    Question

  • I'm trying to use following code to retrieve the user alias of logged in user.

     private async Task<User> GETUser()
        {
            string alias = await UserInformation.GetDomainNameAsync();
            string displayName = await UserInformation.GetDisplayNameAsync();
            string[] domainAlias = alias.Split('\\');
            if (domainAlias != null && domainAlias.Length == 2)
            {
                 string UserAlias = domainAlias[1];
                string UserName = displayName;
            }
    
        }
    

    When i run the Application some times i receive my domain ID and LoginID/UserAlias (NT credentials), some times i receive alias has EMPTY. In some systems, when i call UserInformation.GetDomainNameAsync() and GetDisplayNameAsync it always gives me Empty Strings, is there capability that we are missing in Windows Store Applications?. Please let me know as early as possible root cause of this issue


    Mahender

    Sunday, July 20, 2014 8:40 PM

Answers