Upload FastSeekWpf/App.xaml.cs
Browse files- FastSeekWpf/App.xaml.cs +4 -24
FastSeekWpf/App.xaml.cs
CHANGED
|
@@ -148,7 +148,6 @@ public partial class App : Application
|
|
| 148 |
|
| 149 |
if (!elevated)
|
| 150 |
{
|
| 151 |
-
// Still try scanning so user sees the exact error messages in log
|
| 152 |
PrintInfo("Attempting scan anyway (will likely fail without elevation)...");
|
| 153 |
}
|
| 154 |
|
|
@@ -160,41 +159,22 @@ public partial class App : Application
|
|
| 160 |
|
| 161 |
foreach (var drive in drives)
|
| 162 |
{
|
| 163 |
-
ScanResult? scan = null;
|
| 164 |
-
string method = "none";
|
| 165 |
-
|
| 166 |
try
|
| 167 |
{
|
| 168 |
using var reader = new MftReader(drive);
|
|
|
|
| 169 |
|
| 170 |
-
scan
|
| 171 |
-
if (scan != null)
|
| 172 |
-
{
|
| 173 |
-
method = "direct";
|
| 174 |
-
Logger.Log($"Direct scan OK for {drive.Letter}: {scan.Records.Count} records");
|
| 175 |
-
}
|
| 176 |
-
else
|
| 177 |
-
{
|
| 178 |
-
Logger.Log($"Direct scan unavailable for {drive.Letter}, trying fallback");
|
| 179 |
-
scan = reader.Scan();
|
| 180 |
-
if (scan != null && scan.Records.Count > 0)
|
| 181 |
-
{
|
| 182 |
-
method = "fallback";
|
| 183 |
-
Logger.Log($"Fallback scan OK for {drive.Letter}: {scan.Records.Count} records");
|
| 184 |
-
}
|
| 185 |
-
}
|
| 186 |
-
|
| 187 |
-
if (scan != null && scan.Records.Count > 0)
|
| 188 |
{
|
| 189 |
index.PopulateFromScan(scan, drive.Root);
|
| 190 |
totalRecords += scan.Records.Count;
|
| 191 |
-
PrintLine(ConsoleColor.Green, $" {drive.Letter}", $"{scan.Records.Count:N0} records
|
| 192 |
}
|
| 193 |
else
|
| 194 |
{
|
| 195 |
PrintError($" {drive.Letter}: 0 records");
|
| 196 |
if (!elevated)
|
| 197 |
-
PrintInfo(" ↑
|
| 198 |
}
|
| 199 |
}
|
| 200 |
catch (Exception ex)
|
|
|
|
| 148 |
|
| 149 |
if (!elevated)
|
| 150 |
{
|
|
|
|
| 151 |
PrintInfo("Attempting scan anyway (will likely fail without elevation)...");
|
| 152 |
}
|
| 153 |
|
|
|
|
| 159 |
|
| 160 |
foreach (var drive in drives)
|
| 161 |
{
|
|
|
|
|
|
|
|
|
|
| 162 |
try
|
| 163 |
{
|
| 164 |
using var reader = new MftReader(drive);
|
| 165 |
+
var scan = reader.ScanAny();
|
| 166 |
|
| 167 |
+
if (scan.Records.Count > 0)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 168 |
{
|
| 169 |
index.PopulateFromScan(scan, drive.Root);
|
| 170 |
totalRecords += scan.Records.Count;
|
| 171 |
+
PrintLine(ConsoleColor.Green, $" {drive.Letter}", $"{scan.Records.Count:N0} records");
|
| 172 |
}
|
| 173 |
else
|
| 174 |
{
|
| 175 |
PrintError($" {drive.Letter}: 0 records");
|
| 176 |
if (!elevated)
|
| 177 |
+
PrintInfo(" ↑ Expected when not running as Administrator.");
|
| 178 |
}
|
| 179 |
}
|
| 180 |
catch (Exception ex)
|