Ask a Question related to ASP.NET Security, Design and Development.
-
Retrieve User Name in C#.net
Hi All,
I am trying to find how to retrieve the user name
using .Net. I know how to retrieve the user login using
HttpContext.Current.User.Identity.Name but I ned to
retrieve the name and not the login.
Thanks In Advance.
Guest
-
Retrieve URL from DB
Does anyone know how to pull a URL from a DB? Here's my example: I have a database with training records in it. Inside the DB people fall under... -
Cannot retrieve a correct instance from a ListBox in a User Contro
Hello, I'm trying to develop a simple Web User Control that contains two list boxes, Add and Remove buttons. This User Control transfers the... -
retrieve *.jpg
How can I enter a upc # and retrieve a *.jpg image based on the upc I enter. I have thousands of images, so I cannot use a query and insert a... -
after logout, how to retrieve an expired page if user click 'back' button?
hi everyone, i've made a login and logout page, after user have logout, i want to retrieve an expired page if user click the 'back' button to... -
retrieve generated ID
Hi, I'm using a JDBC T4 driver to connect to a DB2 8.2 database. Is there an easy way to retrieve the value of a generated key, other than... -
Brock Allen #2
Re: Retrieve User Name in C#.net
There's no API in ASP.NET to do this for you. You'll have to take the login
you have and query whatever the authentication source is to determine that
info.
-Brock
DevelopMentor
[url]http://staff.develop.com/ballen[/url]
> Hi All,
>
> I am trying to find how to retrieve the user name using .Net. I know
> how to retrieve the user login using
> HttpContext.Current.User.Identity.Name but I ned to retrieve the name
> and not the login.
>
> Thanks In Advance.
>
Brock Allen Guest
-
Dominick Baier [DevelopMentor] #3
Re: Retrieve User Name in C#.net
So - i guess your backend store is AD ?? If yes use the classes found in System.DirectoryService to query for the name - or wait till Joe Kaplan jumps on the thread :)
---
Dominick Baier - DevelopMentor
[url]http://www.leastprivilege.com[/url]
nntp://news.microsoft.com/microsoft.public.dotnet.framework.aspnet.security/<7287632465065094985424@msnews.microsoft.com>
There's no API in ASP.NET to do this for you. You'll have to take the login
you have and query whatever the authentication source is to determine that
info.
-Brock
DevelopMentor
[url]http://staff.develop.com/ballen[/url]
> Hi All,
>
> I am trying to find how to retrieve the user name using .Net. I know
> how to retrieve the user login using
> HttpContext.Current.User.Identity.Name but I ned to retrieve the name
> and not the login.
>
> Thanks In Advance.
>
[microsoft.public.dotnet.framework.aspnet.security]
Dominick Baier [DevelopMentor] Guest
-
Paul Clement #4
Re: Retrieve User Name in C#.net
On Tue, 15 Mar 2005 14:43:07 -0800, <anonymous@discussions.microsoft.com> wrote:
¤ Hi All,
¤
¤ I am trying to find how to retrieve the user name
¤ using .Net. I know how to retrieve the user login using
¤ HttpContext.Current.User.Identity.Name but I ned to
¤ retrieve the name and not the login.
I don't have a C# example but the below should be easy to convert. The System.DirectoryServices
namespace is required:
Dim DomainUser As String =
System.Security.Principal.WindowsIdentity.GetCurre nt.Name.Replace("\", "/")
Dim ADEntry As New System.DirectoryServices.DirectoryEntry("WinNT://" & DomainUser)
Dim FullName As String = ADEntry.Properties("FullName").Value
Paul
~~~~
Microsoft MVP (Visual Basic)
Paul Clement Guest
-
Joe Kaplan \(MVP - ADSI\) #5
Re: Retrieve User Name in C#.net
If it is AD as the backend, the System.DirectoryServices and LDAP is a
possible way to go. You can also potentially p/invoke TranslateName. That
might be easier.
It depends a lot on which particular name you want. AD has a lot of them
(CN, sAMAccountName, NT name, userPrincipalName, displayName,
distiguishedName, email address, etc.). There are lots of options.
Joe K.
"Dominick Baier [DevelopMentor]" <dbaier@pleasepleasenospamdevelop.com>
wrote in message news:OkLaZ1fKFHA.3392@TK2MSFTNGP10.phx.gbl...> So - i guess your backend store is AD ?? If yes use the classes found in
> System.DirectoryService to query for the name - or wait till Joe Kaplan
> jumps on the thread :)
>
>
>
> ---
> Dominick Baier - DevelopMentor
> [url]http://www.leastprivilege.com[/url]
>
>
> nntp://news.microsoft.com/microsoft.public.dotnet.framework.aspnet.security/<7287632465065094985424@msnews.microsoft.com>
>
> There's no API in ASP.NET to do this for you. You'll have to take the
> login
> you have and query whatever the authentication source is to determine that
> info.
>
> -Brock
> DevelopMentor
> [url]http://staff.develop.com/ballen[/url]
>>> > Hi All,
> >
> > I am trying to find how to retrieve the user name using .Net. I know
> > how to retrieve the user login using
> > HttpContext.Current.User.Identity.Name but I ned to retrieve the name
> > and not the login.
> >
> > Thanks In Advance.
> >
>
>
> [microsoft.public.dotnet.framework.aspnet.security]
Joe Kaplan \(MVP - ADSI\) Guest



Reply With Quote

