Created
September 10, 2018 17:51
-
-
Save MairwunNx/1e17716df93e4a7cb3f230f6dfe9090b to your computer and use it in GitHub Desktop.
Not worked code 0_____0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static async void Get() | |
{ | |
GetLoggerConfig.Log.Info("Checking availability first install settings"); | |
if (!File.Exists("$SacredUtils\\conf\\firstinstall.json")) | |
{ | |
File.WriteAllBytes("$SacredUtils\\conf\\firstinstall.json", Properties.Resources.firstinstall); | |
GetLoggerConfig.Log.Info("First install settings were created in conf folder"); | |
} | |
IFirstInstall firstInstall = new ConfigurationBuilder<IFirstInstall>() | |
.UseJsonFile("$SacredUtils\\conf\\firstinstall.json").Build(); | |
if (firstInstall.First) | |
{ | |
try | |
{ | |
FtpClient client = new FtpClient("145.14.144.87"); | |
client.Credentials = new NetworkCredential("***", "***"); | |
await Task.Run(() => client.ConnectAsync()); | |
await Task.Run(() => client.DownloadFileAsync("$SacredUtils\\conf\\statinfo.json", "/sacredutils/downloads.json")); | |
await Task.Run(() => client.DisconnectAsync()); | |
GetLoggerConfig.Log.Info("Download statistic successfully downloaded!"); | |
Add(); | |
} | |
catch (Exception e) | |
{ | |
GetLoggerConfig.Log.Error("An error occurred while retrieving the statistics file!"); | |
GetLoggerConfig.Log.Error(e.ToString); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment