Click to See Complete Forum and Search --> : USB Port.
trevesp
April 4th, 2004, 03:30 PM
Hello,
How can I read/write to my local USB Port on my computer in VB.NET. I was thinking using the Stream Class, but I am having difficulties.
Any ideas/suggestions ??
Regards,
Paolo
kasracer
April 4th, 2004, 04:19 PM
The same way you write to any hard drive. If your program isn't running from the USB device, you'll need to use the absolute path which means you'll need to get the drive letter of the removable device.
Craig Gemmill
April 4th, 2004, 04:54 PM
I think he might be talking about something more then simple removable storage.
This is not a task that is easily done. The problem is that you need to have kernel level drivers to make the communication possible. There are some alternatives to writing your own drivers:
1) See if the product provides an SDK for developers. This would be the preferred choice as it would save you a lot of work.
2) You can buy 3rd party components that take care of the low-level stuff for you. I just saw this one by componentscience (http://www.componentscience.net/Elements/TransPort/) in MSDN Magazine.
3) USB <-> RS232 cables, which allow you to read/write to the device using COM. http://froogle.google.com/froogle?q=USB+to+RS232&hl=en&lr=&ie=UTF-8&tab=wf&scoring=p
4) Attempt to use free USB libraries that are good at best. http://libusb-win32.sourceforge.net/
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.