Re: Info about user account in which current process is running
From: Henning Krause (newsgroup.no_at_spam.infinitec.de)
Date: 06/08/04
- Next message: Tim Mackey: "Re: Urgent - .NET1.1 - Failure to load dll"
- Previous message: peshrad: "Info about user account in which current process is running"
- In reply to: peshrad: "Info about user account in which current process is running"
- Next in thread: peshrad: "Re: Info about user account in which current process is running"
- Reply: peshrad: "Re: Info about user account in which current process is running"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
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.
>
>
- Next message: Tim Mackey: "Re: Urgent - .NET1.1 - Failure to load dll"
- Previous message: peshrad: "Info about user account in which current process is running"
- In reply to: peshrad: "Info about user account in which current process is running"
- Next in thread: peshrad: "Re: Info about user account in which current process is running"
- Reply: peshrad: "Re: Info about user account in which current process is running"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|