2018-07-16 17:10:45 -07:00
|
|
|
|
using System;
|
2020-09-10 21:10:32 -07:00
|
|
|
|
using System.IO;
|
2018-07-16 17:10:45 -07:00
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using BurnOutSharp;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Test
|
|
|
|
|
|
{
|
|
|
|
|
|
class Program
|
|
|
|
|
|
{
|
|
|
|
|
|
static void Main(string[] args)
|
|
|
|
|
|
{
|
2018-07-22 23:46:49 -07:00
|
|
|
|
var p = new Progress<FileProtection>();
|
|
|
|
|
|
p.ProgressChanged += Changed;
|
2018-07-16 17:10:45 -07:00
|
|
|
|
foreach (string arg in args)
|
|
|
|
|
|
{
|
2020-10-28 12:05:48 -07:00
|
|
|
|
string protections = string.Join("\r\n", ProtectionFind.Scan(arg, true, p).Select(kvp => kvp.Key + ": " + kvp.Value.TrimEnd()));
|
2020-09-10 21:10:32 -07:00
|
|
|
|
Console.WriteLine(protections);
|
|
|
|
|
|
using (StreamWriter sw = new StreamWriter(File.OpenWrite($"{DateTime.Now:yyyy-MM-dd_HHmmss}.txt")))
|
|
|
|
|
|
{
|
|
|
|
|
|
sw.WriteLine(protections);
|
|
|
|
|
|
}
|
2018-07-16 17:10:45 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
2020-09-10 21:10:32 -07:00
|
|
|
|
Console.WriteLine("Press any button to close...");
|
2018-07-16 17:10:45 -07:00
|
|
|
|
Console.ReadLine();
|
2019-09-27 23:52:24 -07:00
|
|
|
|
|
|
|
|
|
|
//ProtectionFind.ScanSectors('D', 2048);
|
2018-07-16 17:10:45 -07:00
|
|
|
|
}
|
2018-07-22 23:46:49 -07:00
|
|
|
|
|
|
|
|
|
|
private static void Changed(object source, FileProtection value)
|
|
|
|
|
|
{
|
2019-09-29 12:08:31 -07:00
|
|
|
|
Console.WriteLine($"{value.Percentage * 100:N2}%: {value.Filename} - {value.Protection}");
|
2018-07-22 23:46:49 -07:00
|
|
|
|
}
|
2018-07-16 17:10:45 -07:00
|
|
|
|
}
|
|
|
|
|
|
}
|