If you try to open a drive directly with C# classes (like FileStream) you will encounter a runtime error. Basically what you want to do is open the file „\\.\X:“ for a single partition, or if you want to gain access to the physical drive with the partition table and everything „\\.\PhysicalDrive0“. This will result in:

“FileStream will not open Win32 devices such as disk partitions and tape drives. Avoid use of „\\.\“ in the path.”

Some confusion might occur when you try to open a „normal“ path and still receive some error messages, there are still some reserved keywords which cannot be used (like PRN or CON).

To get around this problem, what you have to do is take a P/Invoke to call the Win32-API function CreateFile() from kernel32.dll.