user name in database!

  • Thread starter Thread starter rcoco
  • Start date Start date
R

rcoco

Hi,
I'm wondering how to do this, I'm working on the on a datagrid and I'm
using windows authentication. I managed to get username on to a login
form, but I want it to be stored into the database.The code of web
config looks like:
authentication mode="Windows"
identity impersonate="true"
And the Login page looks like on(Page_load):
Response.Write(Page.User.Identity.Name);
Thanks.
 
Thanks David,
This is actually what I wanted. But I was wondering if you could
actually change this code into c#.I'm not familiar with VB.

Dim username As String
username = User.Identity.Name
Dim User As System.Security.Principal.IPrincipal
User = System.Web.HttpContext.Current.User
Dim username As String
username = User.Identity.Name

Thanks.
 
Thanks David,
This is actually what I wanted. But I was wondering if you could
actually change this code into c#.I'm not familiar with VB.

Dim username As String
username = User.Identity.Name
Dim User As System.Security.Principal.IPrincipal
User = System.Web.HttpContext.Current.User
Dim username As String
username = User.Identity.Name

Thanks.

String username = User.Identity.Name;
System.Security.Principal.IPrincipal User =
System.Web.HttpContext.Current.User;
String userName = User.Identity.Name;
 
Back
Top