.NET and USB


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 7 of 7

Thread: .NET and USB

  1. #1
    Join Date
    Aug 2006
    Posts
    12

    Unhappy .NET and USB

    Can any one give a code snippet showing how to interact with an USB mouse or thumb drive,using .NET Windows application.

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    Interact how? The USB drive will appear to .NET like any other disk drive. You can use the System.IO namespace to read from and write to it.
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  3. #3
    Join Date
    Aug 2006
    Posts
    12

    .NET and USB

    System.IO donot have a USB Port. I could see only Serial Port.

  4. #4
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    Please re-read my previous message. To .NET, a USB drive is just like any other disk drive. You open and close files, read from and write to them, the same whether it's a disk or a USB key.
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  5. #5
    Join Date
    Aug 2006
    Posts
    12
    sorry i'm new to this and don't have an idea where to start,
    it would be helpful if u could explain it little more.
    with an example.

  6. #6
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    Here's an example of reading the contents of a file into a string variable: http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=210 . Replace the drive letter in the example ("C:") with the letter of your USB drive.
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  7. #7
    Join Date
    Aug 2006
    Posts
    12
    hi phil,
    thank you..

    will this work if i'm using a usb device and i need to capture its events(interrupts)?. what u said may work for an usb thumb drive but for devices like this, how can i capture events?.

    The problem is i don't have the device to test it. so is there anyone who have done this kinda stuffs...or think some possiblities.

Similar Threads

  1. Replies: 2
    Last Post: 09-11-2007, 12:42 AM
  2. Replies: 0
    Last Post: 08-04-2006, 05:34 AM
  3. Replies: 0
    Last Post: 07-12-2005, 03:52 AM
  4. Linux support for USB devices?
    By alan chua in forum Open Source
    Replies: 1
    Last Post: 05-22-2000, 09:50 AM
  5. Linux support for USB devices?
    By alan chua in forum Open Source
    Replies: 0
    Last Post: 05-17-2000, 11:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center