Results 1 to 14 of 14

Thread: [2005] Accessing Device on USB Port

  1. #1

    Thread Starter
    Hyperactive Member mulhearn22's Avatar
    Join Date
    Jun 2007
    Location
    Cherry Hill, NJ
    Posts
    347

    [2005] Accessing Device on USB Port

    Hi,

    OK, I have been doing some research into accessing devices on a USB port and it's kind of helped, but not really. From what I understand, I can use the IO.Port namespace to access a device on a USB port (usually). Let me know if this is incorrect.

    First, I made a simple program that looped through the ports available. I get COM1 and COM3, but I have 4 USB ports. Where are the others?

    My Code:
    Code:
    Dim comm As New List(Of IO.Ports.SerialPort) 'list of comm ports
            For Each PNstr As String In IO.Ports.SerialPort.GetPortNames() 'get a list of Com Port Names
                comm.Add(New IO.Ports.SerialPort) 'insert new port into list
                comm(comm.Count - 1).PortName = PNstr 'set the name
            Next
    
            ListBox1.DataSource = comm
            ListBox1.DisplayMember = "PortName"
    TIA,
    Matt
    VS 2010 / .NET 4.0 / ASP.NET 4.0

  2. #2
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    Re: [2005] Accessing Device on USB Port

    usb ports do not show up as com ports unless you have a serial port adapter plugged into a usb port.

    i did a lot of work for suburban cable / comcast in the philly area. i had an apartment in phoenixville.
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  3. #3

    Thread Starter
    Hyperactive Member mulhearn22's Avatar
    Join Date
    Jun 2007
    Location
    Cherry Hill, NJ
    Posts
    347

    Re: [2005] Accessing Device on USB Port

    So how would I get a list of USB ports and how do I access the devices plugged into them?

    Really? My gf is from Collegeville and I'm from Lansdale. Small world.
    VS 2010 / .NET 4.0 / ASP.NET 4.0

  4. #4
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    Re: [2005] Accessing Device on USB Port

    i was there from 1996 - 2002. The Trappe!

    i am not certain what you are trying to do. you will need to talk to the driver for the device attached to the USB port.
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  5. #5

    Thread Starter
    Hyperactive Member mulhearn22's Avatar
    Join Date
    Jun 2007
    Location
    Cherry Hill, NJ
    Posts
    347

    Re: [2005] Accessing Device on USB Port

    I've never been there but I have driven past the Trappe several times. Gadzooks!

    Well, what I'm trying to do is take my music off of my iPod. I know there are programs out there but they all cost money (F that) and honestly I'd like to learn how to work with Serial Ports.

    How do I find the driver for my iPod? Any clue?
    VS 2010 / .NET 4.0 / ASP.NET 4.0

  6. #6
    PowerPoster Jenner's Avatar
    Join Date
    Jan 2008
    Location
    Mentor, OH
    Posts
    3,712

    Re: [2005] Accessing Device on USB Port

    It depends on the device you're plugging in. USB doesn't concern itself with "what" port a piece of hardware is on, just whether it's connected to the computer or not and that you can use it.

    If it's a thumb-drive, it'll be in the list of drives.
    If it's a printer, it'll be in the list of printers.
    If it's a mouse or keyboard, it'll be in the mouse/HID list.
    If it's something that emulates an old-fashioned COM port, it'll be in the Serial Port list as mentioned.

    What are you trying to detect hooked up?
    My CodeBank Submissions: TETRIS using VB.NET2010 and XNA4.0, Strong Encryption Class, Hardware ID Information Class, Generic .NET Data Provider Class, Lambda Function Example, Lat/Long to UTM Conversion Class, Audio Class using BASS.DLL

    Remember to RATE the people who helped you and mark your forum RESOLVED when you're done!

    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe. "
    - Albert Einstein

  7. #7
    PowerPoster Jenner's Avatar
    Join Date
    Jan 2008
    Location
    Mentor, OH
    Posts
    3,712

    Re: [2005] Accessing Device on USB Port

    Sorry, just missed your post about it being an iPod. iPods are a little flaky and love to exist in their own little worlds compared to all the other MP3 players out there, but it should attach and be detected as a drive.

    Connect it and see. Reading other posts, I see people have figured out "which drive is the iPod" by checking all their drives for the specific directory structure of the iPod. When a drive matches up, they got it.

    You can then transfer things on and off it with simple IO.FileSystem commands.
    My CodeBank Submissions: TETRIS using VB.NET2010 and XNA4.0, Strong Encryption Class, Hardware ID Information Class, Generic .NET Data Provider Class, Lambda Function Example, Lat/Long to UTM Conversion Class, Audio Class using BASS.DLL

    Remember to RATE the people who helped you and mark your forum RESOLVED when you're done!

    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe. "
    - Albert Einstein

  8. #8
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    Re: [2005] Accessing Device on USB Port

    Code:
            Dim sDrv() As System.IO.DriveInfo = IO.DriveInfo.GetDrives
            For sX As Integer = 0 To sDrv.Length - 1
                If sDrv(sX).IsReady Then
                    Debug.Write("drive ")
                    Debug.WriteLine(sDrv(sX).RootDirectory)
                    Debug.WriteLine(sDrv(sX).Name)
                    Debug.WriteLine(sDrv(sX).VolumeLabel)
                    Debug.WriteLine(sDrv(sX).DriveFormat)
                End If
            Next
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  9. #9
    Member
    Join Date
    Feb 2009
    Posts
    41

    Re: [2005] Accessing Device on USB Port

    Hi Dewayne,

    I have a similar question. The device plugged into my USB port emulates a serial port and shows up in the Windows XP Hardware Manager list as 'COMX'. Can I just treat it as a serial port and use your excellent serial port examples to work with it?

    Thanks,

    Jan Didden

  10. #10
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    Re: [2005] Accessing Device on USB Port

    yes.
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  11. #11
    Member
    Join Date
    Feb 2009
    Posts
    41

    Re: [2005] Accessing Device on USB Port

    Cool. Thanks!

  12. #12

    Re: [2005] Accessing Device on USB Port

    What if its a camera?
    C0c1 was here! I use viual basic 2008 express edition I am also a noob so please help me
    www.cstudios.co.cc

  13. #13
    Member
    Join Date
    Feb 2009
    Posts
    41

    Re: [2005] Accessing Device on USB Port

    Quote Originally Posted by dbasnett
    yes.
    Hi Dewayne,

    After I have found the serial ports on my system, I have to check which is the one for the external USB device I want to talk to. I would gess that I would check a driver property like manufacturer name or driver name (I have that information). The VB .NET Help info hints that such a function is available for a SerialPort but I can't find it anywhere. Do you (or anybody else) know where I can find that kind of stuff?

    Thanks,

    Jan Didden

  14. #14

    Thread Starter
    Hyperactive Member mulhearn22's Avatar
    Join Date
    Jun 2007
    Location
    Cherry Hill, NJ
    Posts
    347

    Re: [2005] Accessing Device on USB Port

    OK so I was a little dormant, but now I'm back. I've been all over the web and I still can't find a way to access the files on my iTouch. One would think this would be a highly published topic.

    I tried looking for it in my drives but all I get back are C: and D: (OS backup). I tried looking at serial ports and get back COMM1 and COMM3, but neither are it. Where the hell is this device? Do I have to use its driver to access the files? If so, does anyone have a good tutorial to using a devices driver?

    Any and all help is GREATLY appreciated!!
    VS 2010 / .NET 4.0 / ASP.NET 4.0

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width