TechTalkz.com Logo Ask the Expert

Go Back   TechTalkz.com Technology & Computer Troubleshooting Forums > Tech Support Archives > Microsoft > Microsoft Device Drivers

Notices

Controlling USB devices from C#

Microsoft Device Drivers


Reply
 
Thread Tools Display Modes
Old 05-12-2007, 02:43 AM   #1
Miguel Gómez
Guest
 
Posts: n/a
Controlling USB devices from C#

Hi, every body!

I would want to know, if is there any manner to control an USB device ( a code bar reader, for example) connected to the PC, using C# code (or VB). I must be able, for example, to disable reading, an enable it again, depending on the bussiness logic, using C# or VB code.

Does such a class exist in the .NET Framework?

I sicerelly appreciate any help in this subject.

thank you

Mike
  Reply With Quote
Old 05-12-2007, 02:43 AM   #2
Maxim S. Shatskih
Guest
 
Posts: n/a
Re: Controlling USB devices from C#

Write your own wrapper around CreateFile and DeviceIoControl, possibly
using pinvoke.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com

"Miguel Gómez" <mikegomez@telefonica.net> wrote in message
news:OZLyBHeLIHA.3940@TK2MSFTNGP05.phx.gbl...
Hi, every body!

I would want to know, if is there any manner to control an USB device ( a code
bar reader, for example) connected to the PC, using C# code (or VB). I must be
able, for example, to disable reading, an enable it again, depending on the
bussiness logic, using C# or VB code.

Does such a class exist in the .NET Framework?

I sicerelly appreciate any help in this subject.

thank you

Mike

  Reply With Quote
Old 05-12-2007, 02:44 AM   #3
Pavel A.
Guest
 
Posts: n/a
Re: Controlling USB devices from C#

Hi, what do you mean by "disabling reading" ?
Do you want to enable the barcode reader from the app only
when it needs to scan, and keep it disabled at other times,
to avoid interference with keyboard input?

--PA

"Miguel Gómez" <mikegomez@telefonica.net> wrote in message news:OZLyBHeLIHA.3940@TK2MSFTNGP05.phx.gbl...
Hi, every body!

I would want to know, if is there any manner to control an USB device ( a code bar reader, for example) connected to the PC,
using C# code (or VB). I must be able, for example, to disable reading, an enable it again, depending on the bussiness logic,
using C# or VB code.

Does such a class exist in the .NET Framework?

I sicerelly appreciate any help in this subject.

thank you

Mike


  Reply With Quote
Old 05-12-2007, 02:44 AM   #4
Miguel Gómez
Guest
 
Posts: n/a
Re: Controlling USB devices from C#

¡YES, Pavel!, That's exactly what I want to do.
Caan you help me, please?


"Pavel A." <pavel_a@NOwritemeNO.com> escribió en el mensaje
news:%23cbr4wrLIHA.484@TK2MSFTNGP06.phx.gbl...
> Hi, what do you mean by "disabling reading" ?
> Do you want to enable the barcode reader from the app only
> when it needs to scan, and keep it disabled at other times,
> to avoid interference with keyboard input?
>
> --PA
>
> "Miguel Gómez" <mikegomez@telefonica.net> wrote in message
> news:OZLyBHeLIHA.3940@TK2MSFTNGP05.phx.gbl...
> Hi, every body!
>
> I would want to know, if is there any manner to control an USB device ( a
> code bar reader, for example) connected to the PC, using C# code (or VB).
> I must be able, for example, to disable reading, an enable it again,
> depending on the bussiness logic, using C# or VB code.
>
> Does such a class exist in the .NET Framework?
>
> I sicerelly appreciate any help in this subject.
>
> thank you
>
> Mike
>



  Reply With Quote
Reply

Thread Tools
Display Modes



< Home - Windows Help - MS Office Help - Hardware Support >


New To Site? Need Help?

All times are GMT +5.5. The time now is 02:01 PM.


vBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO
Copyright © 2005-2010, TechTalkz.com. All Rights Reserved - Privacy Policy
Valid XHTML 1.0 Transitional