|Then the better thing would be to first go and learn ASP.NET's authentication modules, or the framework being used. You might be using Identity; or a
WebSecurity-based method of authentication which can be answered by the way you create your application -- as a new project or a new website.
If that is the
WebSecurity[^]-based application (a website), then you can do that like this,
var username = WebSecurity.CurrentUserName;
Or you can get the UserId of the user and query the database to get the Name.
Otherwise, if you're using Identity[^], then you would have to query the database anyway; Entity Framework has got you covered!
You can get the values from the database as,
db.Users.FirstOrDefault(x => x.Id == someUserId);
You can then move on and learn other basics about ASP.NET from MSDN, or the best option. Test, try and solve method!
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~