public string Solve(string url) { var captchaFile = FileSystemHelpers.GetFile("captcha.jpg"); new WebClient().DownloadFile(new Uri(url), captchaFile.FullName); captchaFile.OpenFile(); var solved = io.RequestInput("Please, solve captcha and enter result here"); if (captchaFile.Exists) { try { captchaFile.Delete(); } catch (IOException) { io.Print("File is opened somewhere else and will be not deleted. " + $"You can delete it manually, path is: {captchaFile.FullName}"); } } return(solved); }
private static FileInfo GetFile() { return(FileSystemHelpers.GetFile(OptionsFileName)); }