all groups > dotnet security > september 2004 >
You're in the

dotnet security

group:

How to access NT restricted files in .Net?


How to access NT restricted files in .Net? Jim Bancroft
9/22/2004 8:04:55 AM
dotnet security:

Hi everyone,

I've used the Win32 API before to access files on restricted
directories. This work involved the "LogonUser" and
"ImpersonateLoggedOnUser" API functions, among others.
I'm into .Net now, and while I could continue using the API
functions to access these files, I was curious if there were any framework
objects which work the same magic? If you know where I should look, thanks
in advance for the help.

-Jim

Re: How to access NT restricted files in .Net? Rob Teixeira [MVP]
9/23/2004 6:21:29 PM
You still need the LogonUser API to obtain the token, but you can then
impersonate with the token by using the .NET WindowsIdentity.Impersonate
method.
Search for that method in the MSDN to get a sample.

-Rob Teixeira [MVP]

[quoted text, click to view]

AddThis Social Bookmark Button