ログインしている現在のユーザーからユーザー名を取得するWPFアプリケーションにユーザー名を表示したいですか?WPFでWindowsユーザー名を取得する方法
私の質問どのようにWPF AppからユーザーにログインしたWindowsのユーザー名を取得できますか?
ログインしている現在のユーザーからユーザー名を取得するWPFアプリケーションにユーザー名を表示したいですか?WPFでWindowsユーザー名を取得する方法
私の質問どのようにWPF AppからユーザーにログインしたWindowsのユーザー名を取得できますか?
System.Security.Principal.WindowsIdentity.GetCurrent().Name
私も見:
Environment.UserName
または
System.Windows.Forms.SystemInformation.UserName
私は自分のために結果を確認するので、それを試すことができません。
を追加しました: 全ユーザー名:
Imports System.DirectoryServices.AccountManagement
Dim userFullName As String = UserPrincipal.Current.DisplayName
コールWindowsIdentity.GetCurrent()
は、WindowsのユーザーIDを取得します。
これから名前を取得できます。 。
System.Security.Principal.WindowsIdentity.GetCurrent()の名前、この1が動作している私だけではなく、ユーザーIDの例の完全なユーザー名を取得できますかあなたの – Ujjwal27
ありがとう:代わりにUjjwal27表示「Ujjwal Vaddepati」 – Ujjwal27
システムを表示します.DirectoryServices.AccountManagement.UserPrincipal.Current.UserPrincipalNameも有用であり、ADALに有意義なヒントを提供するために必要です。 –