Hi,
i'm trying to read CD/DVD bytes.
But when Stream() is Seek() over to 102400 offset, ReadByte() returns -1. It's problem only for CD discs.
Here's my code:
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
internal static extern SafeFileHandle CreateFile(string lpFileName,
FileAccess dwDesiredAccess,
FileShare dwShareMode,
uint lpSecurityAttributes,
FileMode dwCreationDisposition,
int flagsAndAttributes,
uint hTemplateFile);
Microsoft.Win32.SafeHandles.SafeFileHandle handle = null;
handle = CreateFile("\\\\.\\E:",
FileAccess.Read,
FileShare.Read,
0,
FileMode.Open,
FILE_FLAG_NO_BUFFERING | FILE_FLAG_SEQUENTIAL_SCAN,
0);
Stream strm= new FileStream(handle, FileAccess.Read);
strm.Seek(24608768, SeekOrigin.Begin);
int dt=strm.ReadByte();
How can i read all of the disc bytes?
[edit]"Ignore HTML..." option disabled to allow code block to work - OriginalGriff[/edit]