Can I do in the following way and setting <identity impersonate="false"/>
WindowsImpersonationContext context = WindowsIdentity.Impersonate(System.Security.Princi pal.WindowsIdentity.GetCurrent().Token);
//perform action here
context.Undo();
----- Steve C. Orr [MVP, MCSD] wrote: -----
It's the same syntax for ASP and ASP.NET and C# and VB.NET:
Request.ServerVariables("LOGON_USER")
For impersonation details you can look here:
http://msdn.microsoft.com/library/de...ersonation.asp
--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"Z0gS" <an*******@discussions.microsoft.com> wrote in message
news:73**********************************@microsof t.com...
I need the window username and password information so that I can
imporsonate to access a remote file server using the UNC path. How can I do
that not using asp server object but asp .net or c# code. ----- Steve C. Orr [MVP, MCSD] wrote: -----
Try Request.ServerVariables("LOGON_USER").
Note that it may not work consistently if you allow anonymous users
in IIS. Here's more info:
http://www.4guysfromrolla.com/webtech/092298-3.shtml -- I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net> "Z0gS" <an*******@discussions.microsoft.com> wrote in message news:C7**********************************@microsof t.com... Hi How do I the the username that was used when you logged into
Windows from asp .net or c#? Thanks Cheers,
James