copy this code in .cs file
protected void Page_Load(object sender, EventArgs e)
{
string a;
a = System.Security.Principal.WindowsIdentity.GetCurrent().Name.ToString();
string[] b = a.Split('\\');
Label1.Text = b[1].ToString();
string username = b[1].ToString();
Label1.Text = username;
}
in default.aspx page :
add this ::
then run it u will get user name in label. for more info plz do reply it or comment on it
No comments:
Post a Comment