- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
try
{
sw = gcnew StreamWriter(GetIniFileName());
}
catch(UnauthorizedAccessException^ e)
{
MessageBox::Show( "Access is denied.", "Ошибка", MessageBoxButtons::OK, MessageBoxIcon::Error );
ShowException(dynamic_cast<System::Exception^>(e));
return;
}
catch(ArgumentNullException^ e)
{
MessageBox::Show( e->ParamName + ": File path is null.", "Ошибка", MessageBoxButtons::OK, MessageBoxIcon::Error );
ShowException(dynamic_cast<System::Exception^>(e));
return;
}
catch(ArgumentException^ e)
{
MessageBox::Show( e->ParamName + ": Wrong file path.", "Ошибка", MessageBoxButtons::OK, MessageBoxIcon::Error );
ShowException(dynamic_cast<System::Exception^>(e));
return;
}
catch(DirectoryNotFoundException^ e)
{
MessageBox::Show( "The specified path is invalid, such as being on an unmapped drive.", "Ошибка", MessageBoxButtons::OK, MessageBoxIcon::Error );
ShowException(dynamic_cast<System::Exception^>(e));
return;
}
catch(PathTooLongException^ e)
{
MessageBox::Show( "The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. ", "Ошибка", MessageBoxButtons::OK, MessageBoxIcon::Error );
ShowException(dynamic_cast<System::Exception^>(e));
return;
}
catch(IOException^ e)
{
MessageBox::Show( "File path includes an incorrect or invalid syntax for file name, directory name, or volume label syntax. ", "Ошибка", MessageBoxButtons::OK, MessageBoxIcon::Error );
ShowException(dynamic_cast<System::Exception^>(e));
return;
}
catch(SecurityException^ e)
{
MessageBox::Show( "The caller does not have the required permission." + e->ToString(), "Ошибка", MessageBoxButtons::OK, MessageBoxIcon::Error );
ShowException(dynamic_cast<System::Exception^>(e));
return;
}
catch(System::Exception^ e)
{
ShowException(e);
return;
}