I have app that writes text files to any location of the users choosing in
the network. It has been working for 18months. An exception has begun
occurring where a folder on a network share is denying access to the
File.CreateText (_filename) method. The user has write access. They can create
a text file through explorer no problem.
I am not a member of the group that has write access. As a test, I logged
into the network as a Domain Admin and ran the app. No problem writing the
text file.
The server is Win2003 sp1. The code is listed below. Any help would be
appreciated.
Thank you. tberry
.. . .
try {
FileIOPermissio n _fioPermit = new
FileIOPermissio n(FileIOPermiss ionAccess.Write , _filePath);
_fioPermit.Asse rt();
StreamWriter sw = File.CreateText (filename);// Exception occurs here.
for (i = 0; i < count; i++) {
sw.WriteLine((s tring)dataList[i]);
}// for
sw.Flush();
sw.Close();
sw = null;
return true;
} catch(Unauthori zedAccessExcept ion uae) {
// User does not have access rights to file, folder or drive.
.. . .