tags:

views:

526

answers:

2

I want to be able to read and write data directly to and from a disk (i.e. at a sector / cluster level) but I've yet to find a suitable tool for doing this under windows.

I've been trying to figure out how to write my own in C#, but the documentation I've found is sparse and only deals with C++ APIs.

Whats the best way of reading /writing directly to / from a drive in C#? (or can anyone recommend me a tool that allows me to read / write directly from a drive?)

+2  A: 

Honestly, you probably need to look at Platform Invoke if you want to write this code in C#. It lets you interact with unmanaged platform APIs, which you mentioned is the bulk of the information you've found so far :-)

Joel Martinez
+4  A: 

pinvoke.net has a collection of managed code wrappers for essentially all Win32 API's, including those that can talk to the Disk Manager service and perform low level kernel/IO.

Jason