This commit is contained in:
2022-06-08 19:59:58 +03:00
parent 531edcd3cc
commit 51324f6dca
8 changed files with 47 additions and 21 deletions

View File

@@ -61,6 +61,7 @@ namespace PluginManager
}
public static async Task LoadConfig()
{
string path = Functions.dataFolder + "var.dat";
if (File.Exists(path))

View File

@@ -239,8 +239,7 @@ namespace PluginManager.Others
/// <returns></returns>
public static async Task SaveToJsonFile<T>(string file, T Data)
{
string jsonText = JsonSerializer.Serialize(Data, typeof(T), new JsonSerializerOptions { WriteIndented = true });
await File.WriteAllTextAsync(file, jsonText);
using (var s = File.OpenWrite(file)) await JsonSerializer.SerializeAsync(s, Data, typeof(T), new JsonSerializerOptions { WriteIndented = true });
}
/// <summary>