This repository has been archived on 2024-10-24. You can view files and clone it, but cannot push or open issues or pull requests.
NG_2023_Stanislav_Mykhailenko/Lesson_7/Task_1/Classes/ReadFile.cs
Stanislav Mykhailenko f5cf47f213
Add Lesson 7 Task 1
2023-04-19 17:32:11 +03:00

17 lines
380 B
C#

namespace Lesson5.Classes;
using Lesson5.Interfaces;
public class ReadFile : IReadFile
{
public static async Task ReadByPathAsync(string path)
{
if (File.Exists(path))
{
var data = await File.ReadAllTextAsync(path);
Console.WriteLine(data);
}
else
Console.WriteLine("No such file exists.");
}
}