USB in C#

WillemM

Member
Joined
Mar 2, 2003
Messages
7
Location
Holland
Anyone know how to open an USB port in C# for I/O ?
I read somewhere that it has something to do with the windows API function CreateFile. If someone can tell me what the path is to the usb port, it would be of great use.
 
More trouble than its worth ???

Hi,

Youd have to use COM Interop and define all the signatures, convert the types and manage the objects. So its probably more work in C#....

Mandrake
 
Its hardly that complicated. Accessing the USB port does not require COM interoperation, just some simple calls to the Win32 API.
 
If you got a standard comport wrapper. Strip the SetCommDCB, GetCommDCB and the DCB Settings from it. And simply use as portname: \\\.\\[usbdevice] (replace [usbdevice] for the devicename).

Very simple :) if you want to create a wrapper with some functionallity for e.g. mass-storage or imaging, you will have to use the intel samples and all other documents listed in this thread.
 
Originally posted by WillemM
If you got a standard comport wrapper. Strip the SetCommDCB, GetCommDCB and the DCB Settings from it. And simply use as portname: \\\.\\[usbdevice] (replace [usbdevice] for the devicename).

Very simple :) if you want to create a wrapper with some functionallity for e.g. mass-storage or imaging, you will have to use the intel samples and all other documents listed in this thread.

Thx

I already have a working class for dealing with DB9 Serial
 
Back
Top