English 中文(简体)
Howto Flip Removable Bit on USB Drive in C#?
原标题:

How do I Flip the Removable Bit of my USB Pen Drive or HDD in C# like this Tool does?

Thanks in advance!

最佳回答

This is not easily done.

The "removable bit" is in the firmware of the controller on the device, not on the filesystem, and it is not accessible by anything but a custom tool for that device.

And since each chip manufacturer has different ways to access the firmware, and the firmware itself can be at different addresses, it is very unlikely that a universal tool can be made.

Your only option would be to sniff USB packets sent by the original utility, decode them and write a new tool which replicates the behavior.

The link you provide will not work on all USB devices, but works on many.

问题回答

You could search the registry etc and use c# registry commands to flip bits etc. But there is no garantee that the underlying drivers will support the configuration. If you require this functionality than buy a drive that supports it.

This answer probably belongs on Super User: The least fuss way to use a USB drive appear as part of a Hard Drive, is set NTFS symbolic link. Which will make your usb drive appear as a directory. You wont be able to partition it like a hard drive though, but you will be able to index it etc - i have several non hard drive devices configured as symbolic links and the music contained on them appears in media player and windows libraries, all searchable and removeable.

  • Create a directory on your hard drive to be the Mount point
  • Right Click my computer
  • Manage
  • From storage, go to disk management
  • right click your device
  • Choose Add Drive letter or Path
  • Add a path to the directory.

or use the mklink command





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签