Getting Network Connection Status on Win2K

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • dotNetDave

    Getting Network Connection Status on Win2K

    I just discovered that this:

    Dim searcher As New Management.Mana gementObjectSea rcher("SELECT
    NetConnectionSt atus FROM Win32_NetworkAd apter")
    For Each networkAdapter As Management.Mana gementObject In searcher.Get()

    does not work on Win2K to get the network connection status! Does anyone
    have some samples on how to do this same thing on Win2K?

    Thanks!
    David

    =============== ======
    David McCarter

  • Paul Daly (MCP)

    #2
    RE: Getting Network Connection Status on Win2K

    Does this help?




    "dotNetDave " wrote:
    [color=blue]
    > I just discovered that this:
    >
    > Dim searcher As New Management.Mana gementObjectSea rcher("SELECT
    > NetConnectionSt atus FROM Win32_NetworkAd apter")
    > For Each networkAdapter As Management.Mana gementObject In searcher.Get()
    >
    > does not work on Win2K to get the network connection status! Does anyone
    > have some samples on how to do this same thing on Win2K?
    >
    > Thanks!
    > David
    >
    > =============== ======
    > David McCarter
    > www.vsdntips.com[/color]

    Comment

    • dotNetDave

      #3
      RE: Getting Network Connection Status on Win2K

      Okay, this seems to get the IP addresses. Am I to assume that if I find a IP
      address then the computer is connected? (I'm not really up on networking)


      "Paul Daly (MCP)" wrote:
      [color=blue]
      > Does this help?
      >
      > http://www.codeproject.com/csharp/CsTCPIPWMI.asp
      >
      >
      > "dotNetDave " wrote:
      >[color=green]
      > > I just discovered that this:
      > >
      > > Dim searcher As New Management.Mana gementObjectSea rcher("SELECT
      > > NetConnectionSt atus FROM Win32_NetworkAd apter")
      > > For Each networkAdapter As Management.Mana gementObject In searcher.Get()
      > >
      > > does not work on Win2K to get the network connection status! Does anyone
      > > have some samples on how to do this same thing on Win2K?
      > >
      > > Thanks!
      > > David
      > >
      > > =============== ======
      > > David McCarter
      > > www.vsdntips.com[/color][/color]

      Comment

      • Paul Daly (MCP)

        #4
        RE: Getting Network Connection Status on Win2K

        Well... it depends on what level of connectivity you are checking for. If
        you find their IP address, then yes... they are connected to a LAN. (Even if
        they set their IP address statically, the address shouldn't be returned
        unless the connection is live. <- Test this to make sure, but I think that's
        how it works.) However, that doens't mean that they are connected to the
        Internet. You might want to try pinging their default gateway, or maybe even
        some website. It all depends on what you're looking for.

        I know that this is much easier in .NET 2.0. I watched an interview of
        someone at Microsoft who worked on network programability. It was as easy as
        myNetworkConnec tion.IsConnecte d, where myNetworkConnec tion is associated with
        some adapter. Not sure if you can wait for this though.

        Anyway... hope this helps,

        Paul

        "dotNetDave " wrote:
        [color=blue]
        > Okay, this seems to get the IP addresses. Am I to assume that if I find a IP
        > address then the computer is connected? (I'm not really up on networking)
        >
        >
        > "Paul Daly (MCP)" wrote:
        >[color=green]
        > > Does this help?
        > >
        > > http://www.codeproject.com/csharp/CsTCPIPWMI.asp
        > >
        > >
        > > "dotNetDave " wrote:
        > >[color=darkred]
        > > > I just discovered that this:
        > > >
        > > > Dim searcher As New Management.Mana gementObjectSea rcher("SELECT
        > > > NetConnectionSt atus FROM Win32_NetworkAd apter")
        > > > For Each networkAdapter As Management.Mana gementObject In searcher.Get()
        > > >
        > > > does not work on Win2K to get the network connection status! Does anyone
        > > > have some samples on how to do this same thing on Win2K?
        > > >
        > > > Thanks!
        > > > David
        > > >
        > > > =============== ======
        > > > David McCarter
        > > > www.vsdntips.com[/color][/color][/color]

        Comment

        Working...