Re: Info about user account in which current process is running

From: Henning Krause (newsgroup.no_at_spam.infinitec.de)
Date: 06/08/04


Date: Tue, 8 Jun 2004 12:43:49 +0200

Hello,

try

WindowsPrincipal wp = new WindowsPrincipal(WindowsIdentity.GetCurrent());
String username = wp.Identity.Name;

Greetings,
Henning Krause
==========================
Visit my website: http://www.infinitec.de
Try my free Exchange Explorer: Mistaya
(http://www.infinitec.de/?page=products)

"peshrad" <peshrad@BieberGruppe.de> wrote in message
news:#VK9NpTTEHA.2544@TK2MSFTNGP10.phx.gbl...
> I'm using Windows 2K, .NET 1.1 and C#.
>
> I know how I can get info about the current process:
>
> System.Diagnostics.Process cp =
> System.Diagnostics.Process.GetCurrentProcess();
>
> However, how can I get info about the user acount in which this process is
> running?
> (I would like to find out at run time the account name in which my web
> application is running.)
>
> Your kind help would be appreciated.
>
>



Relevant Pages

  • Re: Am I doing this right. Hashing a text file
    ... Henning Krause ... Visit my website: http://www.infinitec.de ... Try my free Exchange Explorer: Mistaya ...
    (microsoft.public.dotnet.security)
  • Re: CDO.Addressee.1 error c0070005 - GetFreeBusy
    ... Henning Krause ... Visit my website: http://www.infinitec.de ... Try my free Exchange Explorer: Mistaya ...
    (microsoft.public.exchange2000.development)
  • Re: Problems with FreeBusy XML
    ... >> Visit my website: http://www.infinitec.de ... >> Try my free Exchange Explorer: Mistaya ... And for that response, the ContentType is ...
    (microsoft.public.exchange.development)
  • Re: Getting EntryID from WebDAV
    ... Visit my website: http://www.infinitec.de ... Try my free Exchange Explorer: Mistaya ... > Ahh, it works a little differently from SQL then. ...
    (microsoft.public.exchange.applications)
  • Re: Workflow-Problem, WebDAV?
    ... Henning Krause ... Visit my website: http://www.infinitec.de ... Try my free Exchange Explorer: Mistaya ...
    (microsoft.public.exchange2000.development)