envornment username code example
Example 1: c# get username
Environment.UserName
Example 2: c# user name session
UserAccount.UserAccountCollection userAccounts = UserAccount.GetInstances("Name='ASPNET'");
foreach ( UserAccount userAccount in userAccounts)
{
MessageBox.Show("Name : "+userAccount.Name
+"\nFullName : "+userAccount.FullName);
}