-1

I want to read data from a USB Device which is detected as CD ROM How to do this with C#

Please Help

Thanks

Abhishek
  • 1,682
  • 2
  • 17
  • 29

2 Answers2

1

You need the USB HID component - here's a tutorial with source code:
http://www.codeproject.com/KB/cs/USB_HID.aspx

Shimmy Weitzhandler
  • 101,809
  • 122
  • 424
  • 632
4b0
  • 21,981
  • 30
  • 95
  • 142
1

In case you have the drive letter you can simply use File.ReadAllText/File.ReadAllLines/File.ReadAllBytes function.

Otherwise, look into getting USB device letter via: How to find USB drive letter?.

Please be more specific on what 'data' refers to in your question to allow me providing you with additional info.

Community
  • 1
  • 1
Shimmy Weitzhandler
  • 101,809
  • 122
  • 424
  • 632
  • I have a question, what if I just wanted the file with a specific extension. E.g. on the CD-ROM drive, there's only one CSV file that I wanted to read. How do I get the path of that file from the CD-ROM drive? – Kala J Jul 08 '14 at 14:27