james
Tue Feb 24 21:52:56 CST 2004
Got it. Thanks. I will give it a try.
james
"Mike Hildner" <mhildner@afweb.com> wrote in message
news:eI1as2z#DHA.1796@TK2MSFTNGP12.phx.gbl...
> Umm, whoops, I forgot to give credit where credit is due. Sorry. That code
> was actually posted by a Mr. Ken Tucker on another Microsoft group (can't
> remember where). Apologies, Ken. There's a glitch or two depending on the
> OS, apparently.
>
> If you want the full story (AFAIK), check out
>
http://vbforums.com/showthread.php?s=&threadid=273454
>
> Thanks Ken,
> Mike
>
>
> "Mike Hildner" <mhildner@afweb.com> wrote in message
> news:OcxWhVy%23DHA.808@TK2MSFTNGP12.phx.gbl...
> > Here's a quickie console VB.NET project that enumerates the com ports.
Not
> > sure if I can attach, so if I can't, give me an email.
> >
> > Mike
> >
> > "james" <jjames700ReMoVeMe at earthlink dot net> wrote in message
> > news:u4SJ7Ny%23DHA.3184@TK2MSFTNGP09.phx.gbl...
> > > I tried this and cannot get VB.NET 2003 to work with this. I even find
> > > references to :
> > > Imports System.Management
> > > in the Help files. But, still adding that outside the module in a
> Console
> > > app. it still generates an error.
> > > (sorry to jump in here but, this looked like an easy way to find the
> > > commports.)
> > > So, I am curious how you are getting this to work.
> > > james
> > >
> > > "Mike Hildner" <mhildner@afweb.com> wrote in message
> > > news:u6J9qgx#DHA.3272@TK2MSFTNGP09.phx.gbl...
> > > > This might help:
> > > >
> > > > Dim moReturn As Management.ManagementObjectCollection
> > > > Dim moSearch As Management.ManagementObjectSearcher
> > > > Dim mo As Management.ManagementObject
> > > >
> > > > moSearch = New Management.ManagementObjectSearcher("Select *
> > from
> > > > Win32_POTSModem")
> > > > moReturn = moSearch.Get
> > > >
> > > > For Each mo In moReturn
> > > > Debug.WriteLine(mo("Name") & " is attached to " &
> > > > mo("AttachedTo"))
> > > > Next
> > > >
> > > >
> > > >
> > > > "Dick Grier" <dick_grierNOSPAM@msn.com> wrote in message
> > > > news:%23ykqpow%23DHA.2336@TK2MSFTNGP11.phx.gbl...
> > > > > Hi,
> > > > >
> > > > > The only way that I know is to P/Invoke (Platform Invoke) the
> > Windows32
> > > > > EnumPorts APIs. There isn't anything in the .NET Framework that
> > > provides
> > > > > this information.
> > > > >
> > > > > Dick
> > > > >
> > > > > --
> > > > > Richard Grier (Microsoft Visual Basic MVP)
> > > > >
> > > > > See www.hardandsoftware.net for contact information.
> > > > >
> > > > > Author of Visual Basic Programmer's Guide to Serial
Communications,
> > 3rd
> > > > > Edition ISBN 1-890422-27-4 (391 pages) published February 2002.
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
> >
>
>