Код: Выделить всё
using System.Diagnostics; //VS22 automatically added this reference during one of my attempts to make this work but I can't remember which it was used for, might not be necessary
class Program
{
static string gameAddress = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + @"\AppData\LocalLow\Owlcat Games"; //... more specific environment locations, just an example
void Main()
{
Console.WriteLine("check 1")
FileFetch();
Console.WriteLine("check 2")
}
public static async void FileFetch()
{
try
{
using (FileStream file1 = new FileStream(gameAddress, FileMode.Open, FileAccess.Read))
{
using (StreamReader file2 = new StreamReader(file1))
{
string text = await file2.ReadToEndAsync();
Console.WriteLine(text);
}
}
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
}
}
Подробнее здесь: https://stackoverflow.com/questions/798 ... older-in-c
Мобильная версия