Re: Network login and e-mail address
- From: "Vadym Stetsyak" <vadym_s@xxxxxxx>
- Date: Wed, 12 Oct 2005 10:38:46 +0300
You can use Environment.UserDomainName if the application is WinForms one
and HttpContext.Current.User.Identity.Name if you are in the ASP.NET
application.
Once you've obtained the domain name
System.DirectoryServices namespace will help you. It contains necessary
classess to query Active Directory for the info you need.
It uses LDAP pathes. Outlook Exchange server can also be queried in the same
way.
--
Vadym Stetsyak aka Vadmyst
http://vadmyst.blogspot.com
"Bruce Wood" <brucewood@xxxxxxxxxx> wrote in message
news:1129078054.358344.268580@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> I've been mucking about with Environment.UserName and similar
> properties in .NET. I can get the user's login name for their machine,
> but unfortunately that doesn't get me much for users logged into our
> corporate network through laptops: all its gets me is their user ID on
> the laptop, which means nothing at the corporate level.
>
> Does anyone know how I can get my hands on the username that was used
> to log into Microsoft Networking? This is our corporate user name and
> it's what I should be using to stamp record updates, etc.
>
> As well, does anyone know how to get my hands on the user's default
> e-mail address, the one that Outlook (et al) uses by default when you
> send an e-mail message?
>
.
- Follow-Ups:
- Re: Network login and e-mail address
- From: Bruce Wood
- Re: Network login and e-mail address
- Prev by Date: Re: C# Windows Form Inheritance Quesiton
- Next by Date: Re: using System.Web.UI not possible in c# 2005 express edition beta 2
- Previous by thread: C# Windows Form Inheritance Quesiton
- Next by thread: Re: Network login and e-mail address
- Index(es):
Relevant Pages
|