public void Download(string[] txIds) { var fileData = _block.GetFile(txIds); var fileName = Path.Combine(Settings.Default.OutputPath, Path.ChangeExtension(txIds[0], fileData.Extension)); File.Delete(fileName); File.WriteAllBytes(fileName, fileData.Data); _messages.Add($"File saved to {fileName}"); }
public void Execute() { _messages.NewLine(); _messages.Add("Searching for text messages"); foreach (var block in _block) { foreach (var transaction in block.Transactions) { var fileData = _block.GetFile(transaction.ToString()); if (fileData == null) { continue; } if (fileData.Extension == ".txt") { _messages.Add($"{transaction} - {fileData.Text}"); } } } }