Controlling USB devices from C#

Discussion in 'Windows Vista Drivers' started by Miguel Gómez, Nov 23, 2007.

  1. 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
     
    Miguel Gómez, Nov 23, 2007
    #1
    1. Advertisements

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

    --
    Maxim Shatskih, Windows DDK MVP
    StorageCraft Corporation

    http://www.storagecraft.com

    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
     
    Maxim S. Shatskih, Nov 23, 2007
    #2
    1. Advertisements

  3. Miguel Gómez

    Pavel A. Guest

    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

    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
     
    Pavel A., Nov 24, 2007
    #3
  4. ¡YES, Pavel!, That's exactly what I want to do.
    Caan you help me, please?
     
    Miguel Gómez, Nov 24, 2007
    #4
  5. Miguel Gómez

    susannamoore53

    Joined:
    Jul 3, 2014
    Messages:
    1
    Likes Received:
    0
    > 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?

    ah,..actually yes for me, any suggestion?
     
    susannamoore53, Jul 3, 2014
    #5
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.