After getting so much information about retrieving .MBR from a storage device, conclusion is to use P/Invoke to call CreateFile
.
But how this can be done in C#? Please illustrate! Your help will be greatly appreciated!!!
[DllImport("kernel32.dll", CharSet = CharSet.Auto,
CallingConvention = CallingConvention.StdCall,
SetLastError = true)]
public static extern SafeFileHandle CreateFile(
string lpFileName,
uint dwDesiredAccess,
uint dwShareMode,
IntPtr SecurityAttributes,
uint dwCreationDisposition,
uint dwFlagsAndAttributes,
IntPtr hTemplateFile
);
http://pinvoke.net/default.aspx/kernel32/CreateFile.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With