Accessing a directory path using different credentials from code in .NEt

T

trivender

Hi,

I am looking for a way which allows me to access network resources
(files or directories) using a different users' credentials in windows.


I want to use a network path from within my application to which the
logged in User will never have access. My application wants to access
this directory but I don't want the user be able to access this
directory through windows explorer. I will create a domain User say
'XUSER' who will have full access on this network path. This username
'XUSER' and its password will be stored in the database.

Any comments?? I am developing my application in VB.NET

Regards,
Trivender $ingh
18/10/2005
 
W

William DePalo [MVP VC++]

I am looking for a way which allows me to access network resources
(files or directories) using a different users' credentials in windows.


I want to use a network path from within my application to which the
logged in User will never have access. My application wants to access
this directory but I don't want the user be able to access this
directory through windows explorer. I will create a domain User say
'XUSER' who will have full access on this network path. This username
'XUSER' and its password will be stored in the database.

Any comments?? I am developing my application in VB.NET

Some time ago I posted a C# class that wraps the native API for
"impersonating" a user whose logon credentials you know:

http://groups.google.com/group/micr...*+author:depalo&rnum=1&hl=en#375ec4661035f7d9

As I said in that post, I'm a Win32 guy so you may want to look for a more
managed solution.

That said, between the calls in that post to user.logon() and user.logoff()
you should be able to access the directory which requires XUSER's
credentials.

Regards,
Will
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top