2010-07-09 41 views

回答

2

我可以幫助你第二部分:安全刪除它。

這裏的an article about a tool from Microsoft,這將允許您安全地從命令行中刪除閃存驅動器。然後使用C#,您可以使用Process類來執行命令行工具。

更新:

你可能會探討Windows API函數CreateFile用於讀取原始磁盤扇區。你需要使用p/invoke來做到這一點。

另一個更新:

我做了搜索,你和其他人有過一些成功的P /調用使用的CreateFile到:

[DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)] 
private static extern Microsoft.Win32.SafeHandles.SafeFileHandle CreateFile(string lpFileName, System.UInt32 dwDesiredAccess, System.UInt32 dwShareMode, IntPtr pSecurityAttributes, System.UInt32 dwCreationDisposition, System.UInt32 dwFlagsAndAttributes, IntPtr hTemplateFile); 

祝您好運!