From ab8ae1524f9c8167cce5275bcfca6ae46277fd4e Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Thu, 8 Oct 2020 14:18:23 -0700 Subject: [PATCH] Actually use the drive letter (nw) --- DICUI.Library/Utilities/Drive.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/DICUI.Library/Utilities/Drive.cs b/DICUI.Library/Utilities/Drive.cs index 183539bd..49c8e6e9 100644 --- a/DICUI.Library/Utilities/Drive.cs +++ b/DICUI.Library/Utilities/Drive.cs @@ -1,5 +1,4 @@ using System.IO; -using System.Linq; using DICUI.Data; namespace DICUI.Utilities @@ -71,7 +70,7 @@ namespace DICUI.Utilities public byte[] ReadSector(long sector) { // Missing drive leter is not supported - if (string.IsNullOrEmpty(DriveInfo?.Name)) + if (string.IsNullOrEmpty(this.DriveInfo?.Name)) return null; // We don't support negative sectors @@ -85,7 +84,7 @@ namespace DICUI.Utilities // Try to read the sector from the device try { - var fs = File.OpenRead(@"\\?\E:"); + var fs = File.OpenRead($"\\\\?\\{this.Letter}:"); fs.Seek(start, SeekOrigin.Begin); byte[] buffer = new byte[sectorSize]; fs.Read(buffer, 0, sectorSize);