how to Get Windows Username in WPF

System.Security.Principal.WindowsIdentity.GetCurrent().Name

I also found:

Environment.UserName

or

System.Windows.Forms.SystemInformation.UserName

I cannot try it so check for yourself the result.

Added:
Full user name:

Imports System.DirectoryServices.AccountManagement

Dim userFullName As String = UserPrincipal.Current.DisplayName

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)