Reputation: 3217
I am trying to access the files with following c# code, but when i try to execute the code i am encountered with exception saying access to path @"\MAHESH-PC\D$\temp\CloudURL.txt is denied .
Impersonation imp = new Impersonation("MAHESH-PC", "mahesh", "welcome"); File.Copy(@"\MAHESH-PC\D$\temp\CloudURL.txt", @"C:\temp\CloudURL.txt", true);
I have given all the access rights to both the temp folders one in the c: drive and other in the d: drive
I have enabled the Impersonation in the IIS , even then i am getting access denied exception , please can i know is their any other settings i should implement to make this working.
Upvotes: 0
Views: 3145
Reputation: 4262
Is impersonation enabled in your web.config? I'm not positive but I wouldn't think enabling impersonation in IIS has any affect on the impersonation of your site. If not, turn it on, or grant the app pool identity read/write access to both your directories and see if that helps.
Also, double check your folder system security. It appears you granted everyone read/write access to the share, but if you're navigating to the path \pc\drive$\ then it may be relying on file system security and not the security on the folder share itself. Make sense?
Upvotes: 1