T
trs-ggcsea
Hi,
I am reading a file from a UNC path in my Visual studio 2005 C# (.NET
2) program and getting an access denied exception. I am unsure if this
access denied is due to the .NET security model, or because I need to
implement impersonation of some sort. I was hoping someone could point
me to an answer or the appropriate documentation, as I have as yet been
unable to google up an answer.
The account the program is running under is an AD user account. Here
is an example of the code I am running:
// the following works correctly for a file that has few
// permission restrictions on it
FileStream fs = new
FileStream("\\\\server\\public\\publicfile.txt",FileMode.Open);
// the following throws an access denied exception for
// a file that has permission restrictions
// the file being access is readable only by domain users
// who are members of the "private" group
FileStream fs = new
FileStream("\\\\server\\private\\privatefile.txt",FileMode.Open);
looks like I need to do something but I am not sure what. I am leaning
towards impersonation.
TIA for any pointers.
John Holder
I am reading a file from a UNC path in my Visual studio 2005 C# (.NET
2) program and getting an access denied exception. I am unsure if this
access denied is due to the .NET security model, or because I need to
implement impersonation of some sort. I was hoping someone could point
me to an answer or the appropriate documentation, as I have as yet been
unable to google up an answer.
The account the program is running under is an AD user account. Here
is an example of the code I am running:
// the following works correctly for a file that has few
// permission restrictions on it
FileStream fs = new
FileStream("\\\\server\\public\\publicfile.txt",FileMode.Open);
// the following throws an access denied exception for
// a file that has permission restrictions
// the file being access is readable only by domain users
// who are members of the "private" group
FileStream fs = new
FileStream("\\\\server\\private\\privatefile.txt",FileMode.Open);
read from UNC paths, however, if there are permissions restrictions, itFrom the above situation, I see I don't need to do anything special to
looks like I need to do something but I am not sure what. I am leaning
towards impersonation.
TIA for any pointers.
John Holder