WindowsPrincipal p = System.Threading.Thread.CurrentPrincipal as
System.Security.Principal.WindowsPrincipal;
p.Identity.Name tells me userId. how do I get out not only the log in name
but also the name of the person who is inlogged in the system???

Signature
LZ
Muhammad Naveed Yaseen - 03 Sep 2007 15:58 GMT
To best my knowledge would only return an initialized
WindowsPrinicipal if somewhere program had assigned this previously,
otherwise this would just be a blank GenericPrincipal.
If the quoted line of code is working, it appears to me that some
piece of code had previously 'constructed' an object of
WindowsPrincipal by itself and then assigned it as thread's principal.
To get WindowsPrinicipal of current OS logged-in user you may do
following
WindowsPrincipal p = new
WindowsPrincipal(WindowsIdentity.GetCurrent());
Muhammad Naveed Yaseen - 03 Sep 2007 16:01 GMT
To best my knowledge Thread.CurrentPrincipal would only return an
initialized WindowsPrinicipal if somewhere program had assigned this
previously, otherwise this would just be a blank GenericPrincipal.
If the quoted line of code is working, it appears to me that some
piece of code had previously 'constructed' an object of
WindowsPrincipal by itself and then assigned it as thread's
principal.
To get WindowsPrinicipal of current OS logged-in user you may do
following
WindowsPrincipal p = new
WindowsPrincipal(WindowsIdentity.GetCurrent());
Lamis - 04 Sep 2007 08:20 GMT
Hi,
Sorry but I still don't get it. How would I be able to get out full name
(user full name) out of the windowsPrincipal p object???

Signature
LZ
> To best my knowledge Thread.CurrentPrincipal would only return an
> initialized WindowsPrinicipal if somewhere program had assigned this
[quoted text clipped - 10 lines]
> WindowsPrincipal p = new
> WindowsPrincipal(WindowsIdentity.GetCurrent());