-1
私はWeb開発と.NETについても新しいです。私はC#を使用してASP.NETで書かれたWebサイトを持っています。セッションを使用しているユーザー名ではなく、現在のユーザーのフルネームを表示するにはどうすればよいですか?私を助けてください。ここにコードがあります。ログインページの背後にあるユーザ名の代わりに表示名を表示する方法#
コード: -
System.Security.Principal.WindowsPrincipal username = System.Threading.Thread.CurrentPrincipal as System.Security.Principal.WindowsPrincipal;
string userName = username.Identity.Name;
if (username.Identity.IsAuthenticated)
{
Session["logged"] = userName;
agentname.Text = Session["logged"].ToString();
}
else
{
agentname.Text = "You are not loggd in please logine first ";
}
if (Session["logged"] == null)
{
agentname.Text = "You are not loggd in please login first ";
}
else
{
agentname.Text = Session["logged"].ToString();
}