whoami?
From: Ric (Ricky_at_Rios.org)
Date: 08/10/03
- Next message: cppdev: "Maximum data size that RSACryptoServiceProvider can encrypt at a time?"
- Previous message: Ademar Gonzalez: "feature or bug?"
- Next in thread: Shel Blauman [MSFT]: "Re: whoami?"
- Reply: Shel Blauman [MSFT]: "Re: whoami?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Sat, 9 Aug 2003 19:41:56 -0700
Using
AppDomain.CurrentDomain.SetPrincipalPolicy
(PrincipalPolicy.WindowsPrincipal);
WindowsPrincipal principal = (WindowsPrincipal)
Thread.CurrentPrincipal;
WindowsIdentity identity = (WindowsIdentity)
principal.Identity;
MessageBox.Show("You Are "+ identity.Name);
In this example, "identity.Name" holds my username as user
of my local PC.
If at the same time I'm logged in to a W200x server with a
different username, how do I get this last one?
- Next message: cppdev: "Maximum data size that RSACryptoServiceProvider can encrypt at a time?"
- Previous message: Ademar Gonzalez: "feature or bug?"
- Next in thread: Shel Blauman [MSFT]: "Re: whoami?"
- Reply: Shel Blauman [MSFT]: "Re: whoami?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|