Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static string ReadFile(string path)
- {
- string result = string.Empty;
- try
- {
- if (path == "../../../ForFiltering.txt")
- {
- result = File.ReadAllText(path);
- }
- }
- catch (IOException)
- {
- Console.WriteLine("Ошибка ввода и вывода!");
- }
- catch (System.Security.SecurityException)
- {
- Console.WriteLine("Ошибка безопасности!");
- }
- catch (UnauthorizedAccessException)
- {
- Console.WriteLine("Ошибка доступа к файлу!");
- }
- catch (Exception)
- {
- Console.WriteLine("Ошибка программы!");
- }
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement