How to get user name in a aspx page

  • Thread starter Thread starter Kanth
  • Start date Start date
K

Kanth

Hi All,

I am developing an .net application (intranet). In the Home page, I would
like to show user name (a welcome message) and I don't know how to get the
user name through NT user ID. Will you please help me.

Thanks in advance.
-- Kanth
 
Hi Jan,

Thanks for your help. But I would like to get user name not the user ID.

Request.ServerVariables["LOGON_USER"].ToString
will return Nt user ID.

Thanks,
- Kanth



Jan Tielens said:
This should work:

Request.ServerVariables["LOGON_USER"].ToString

--
Greetz

Jan Tielens
________________________________
Read my weblog: http://weblogs.asp.net/jan


Kanth said:
Hi All,

I am developing an .net application (intranet). In the Home page, I would
like to show user name (a welcome message) and I don't know how to get the
user name through NT user ID. Will you please help me.

Thanks in advance.
-- Kanth
 
In that case you need to use DirectoryServices and perform a search in
Active Directory for the user with the given logon name. Or, if it's a local
user, get the user information using the WinNT provider (also with the
DirectoryServices library).


Arild

Kanth said:
Hi Jan,

Thanks for your help. But I would like to get user name not the user ID.

Request.ServerVariables["LOGON_USER"].ToString
will return Nt user ID.

Thanks,
- Kanth



Jan Tielens said:
This should work:

Request.ServerVariables["LOGON_USER"].ToString

--
Greetz

Jan Tielens
________________________________
Read my weblog: http://weblogs.asp.net/jan


Kanth said:
Hi All,

I am developing an .net application (intranet). In the Home page, I would
like to show user name (a welcome message) and I don't know how to get the
user name through NT user ID. Will you please help me.

Thanks in advance.
-- Kanth
 
Back
Top