strakamichal
July 31st, 2008, 03:41 AM
Hi all,
i need help with one exception. I know only .Message of this exception and i know which part of code throws it.
Message:
.Message: "The operation was canceled."
Code:
try
{
FileIOPermission perm = new FileIOPermission(FileIOPermissionAccess.Write, file_name);
perm.Assert();
if (!additive && File.Exists(file_name)) File.Delete(file_name);
using(FileStream fs = new FileStream(file_name, FileMode.OpenOrCreate, FileAccess.ReadWrite))
{
using(StreamWriter writer = new StreamWriter(fs))
{
writer.BaseStream.Seek(0, SeekOrigin.End);
writer.Write(content);
writer.Flush();
writer.Close();
result = true;
}
fs.Close();
}
CodeAccessPermission.RevertAssert();
}
catch (System.Exception err)
{
System.Diagnostics.Debug.WriteLine(err.Message);
throw(err);
}
FYI: This Windows application runs for many years, but once this error was occured and stored in log. Can somebody help me? Is anythere List of exception messages, where I can find what does the exception mean?
i need help with one exception. I know only .Message of this exception and i know which part of code throws it.
Message:
.Message: "The operation was canceled."
Code:
try
{
FileIOPermission perm = new FileIOPermission(FileIOPermissionAccess.Write, file_name);
perm.Assert();
if (!additive && File.Exists(file_name)) File.Delete(file_name);
using(FileStream fs = new FileStream(file_name, FileMode.OpenOrCreate, FileAccess.ReadWrite))
{
using(StreamWriter writer = new StreamWriter(fs))
{
writer.BaseStream.Seek(0, SeekOrigin.End);
writer.Write(content);
writer.Flush();
writer.Close();
result = true;
}
fs.Close();
}
CodeAccessPermission.RevertAssert();
}
catch (System.Exception err)
{
System.Diagnostics.Debug.WriteLine(err.Message);
throw(err);
}
FYI: This Windows application runs for many years, but once this error was occured and stored in log. Can somebody help me? Is anythere List of exception messages, where I can find what does the exception mean?