или экспортировать соответствующие функции WinAPI из кернела:
[DllImport("kernel32.dll", SetLastError=true)]
и потом че-нить типа:
void CCFDlg::ReadSector(DWORD startinglogicalsector)
{
// win 2k code
HANDLE hDevice;
DWORD bytesread;
// Creating a handle to drive a: using CreateFile () function ..
char _devicename[] = "\\\\.\\A:";
_devicename[4] += m_intDrive;
hDevice = CreateFile(_devicename,
GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL, OPEN_EXISTING, 0, NULL);
//startinglogicalsector=0;
int numberofsectors=1;
char buf[512];
// Setting the pointer to point to the start of the sector we want to read ..
SetFilePointer (hDevice, (startinglogicalsector*512), NULL, FILE_BEGIN);
ReadFile (hDevice, buffer, 512*numberofsectors, &bytesread, NULL);
SetFilePointer (hDevice, (startinglogicalsector*512), NULL, FILE_BEGIN);
ReadFile (hDevice, buf, 512*numberofsectors, &bytesread, NULL);
ed_Sector.SetWindowText(buf);
}
тока для записи сектора, переписаное на C#