views:

122

answers:

1

Hi everybody! I'm a newbie for C# programming. I have a system that access a hard drive call -'H'. this system allows the authorised users to delete and modify the files in H drive. Now my qusestion is I want to restrict deletion of files, if the same authorized users try to access the drive H directly without using the above mentioned program. Can I solve this problem using C#? or is there any otherway I can restrict access only for direct access of H drive.

Thanks in advance.

+1  A: 

You could setup folder security to prevent the user's from accessing/deleting from the drive.

Give the application a set of credentials it can use to access/manipulate the drive.

You could either setup the system to run as a specified user (eg "run as" or have it running as a windows service), or use impersonation to impersonate a user credential to access the drive.

Russell