G
Guest
I am new to asp.net and am trying to open a word document readonly from the
server. I am not sure how to do that either, but what I tried gave me an
error re: rights. I read the following on impersonation, but got an error
trying it. It is in C# and I translated to vb.net, so perhaps I translated
incorrectly. Could someone show me what to do:
Thanks so much -- below is from the article I mentioned.
To impersonate the authenticating user (User.Identity) only when you run a
particular section of code, you can use the code to follow. This method
requires that the authenticating user identity is of type WindowsIdentity.
System.Security.Principal.WindowsImpersonationContext impersonationContext;
impersonationContext =
((System.Security.Principal.WindowsIdentity)User.Identity).Impersonate();
//Insert your code that runs under the security context of the
authenticating user here.
impersonationContext.Undo();
server. I am not sure how to do that either, but what I tried gave me an
error re: rights. I read the following on impersonation, but got an error
trying it. It is in C# and I translated to vb.net, so perhaps I translated
incorrectly. Could someone show me what to do:
Thanks so much -- below is from the article I mentioned.
To impersonate the authenticating user (User.Identity) only when you run a
particular section of code, you can use the code to follow. This method
requires that the authenticating user identity is of type WindowsIdentity.
System.Security.Principal.WindowsImpersonationContext impersonationContext;
impersonationContext =
((System.Security.Principal.WindowsIdentity)User.Identity).Impersonate();
//Insert your code that runs under the security context of the
authenticating user here.
impersonationContext.Undo();