Click here to Skip to main content
15,898,222 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi Friends,

I want to use USB port in C# and Send & Recieve Data From this port
Please help me
Thanks.
Posted
Updated 26-Jun-11 23:33pm
v2

This[^] could help you out.
 
Share this answer
 
Comments
vahid_erad 26-Jun-11 4:10am    
thanks for solution
but how do use of setupapi.dll and hid.dll ??
i add them in my project but give error "A reference to ... could not be added . please make sure that the file is accessible , and that it is a valid assembly or com component"
[no name] 27-Jun-11 5:34am    
Good Call Abhinav.
Abhinav S 27-Jun-11 5:46am    
Thank you.
[no name] 27-Jun-11 7:26am    
It's my Pleasure Abhinav.
 
Share this answer
 
Comments
[no name] 27-Jun-11 5:34am    
Good Call Ravi. My 5 too.
RaviRanjanKr 27-Jun-11 6:52am    
Thanks :)
[no name] 27-Jun-11 7:26am    
It's my pleasure Ravi.
You're trying to treat the USB port the same as a Serial or Parallel port. You can't. You cannot read/write data to the port itself.

Look at what USB stands for. Universal Serial Bus. It's no different than the explansion slots in your PC. You talk to the device, not the bus.

You communicate with the device attached through whatever means the device exposes to you. You may need an SDK to get at that device or it may emulate some serial port communications. Without knowing what device you're trying to get at, it's impossible to say.
 
Share this answer
 
hi vahid _eard.you can use from web site www.barnamenevis.org .THANK
 
Share this answer
 
Comments
vahid_erad 27-Jun-11 4:39am    
i ask from barnamenevis.org but they didnt answer to my question.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900