Can I do in the following way and setting <identity impersonate="false"/>
WindowsImpersonationContext context = WindowsIdentity.Impersonate(System.Security.Principal.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" <(E-Mail Removed)> wrote in message
news:73203DEE-60D5-43EF-AA4A-(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:C78BD2D5-2803-40E0-A0D3-(E-Mail Removed)...
>> Hi
>>> How do I the the username that was used when you logged into
Windows from
> asp .net or c#? Thanks
>>> Cheers,
>> James
>>>