Author: Dilip Varma | Posted on: 7/2/2008 4:30:01 AM | Views : 484

I want to read a file that exists in the network.

when i write this as simple Console application, this works.

but when i use this as web service([WebMethod]), this gives an error "Access to the Path is denied".

In the web.config, I have enabled the Impersonation.  with this , I could do some operations using "System.Diagnostics.Process.Start(fileName,Arguments,Username,Password,domain). at file name i used "xcopy". so a file copy, create directory, directory copy i could do.

but if i want to use like

    File.Copy(src,dest) or StreamReader sr = new StreamReader("\\NwPcName\ShareFolder\FileName.txt"), the above said exception is generated.


 
...

Go to the complete details ...