Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. System.Windows.Forms.SystemInformation

System.Windows.Forms.SystemInformation

Scheduled Pinned Locked Moved Visual Basic
csharpsysadminquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Ray Cassick
    wrote on last edited by
    #1

    Ok, maybe I am dumb here but I am trying to detect if my computer is connected to the network. I spend about 15 minutes going through the docs and I find the System.Windows.Forms.SystemInformation class with Network property. Seems all too easy... I do the following: Dim NetInfo As System.Windows.Forms.SystemInformation If NetInfo.Network = True Then pnlIndicator.BackColor = Color.Green Else pnlIndicator.BackColor = Color.Red End If ...and I figure, heay great, I should get a green panel when I have my net cable plugged in and it should go read when my cable gets unplugged (I placed this code into a timer tic event hander). NOPE. Does not seem to do anything... Anyone have any darn ideas?

    P 1 Reply Last reply
    0
    • R Ray Cassick

      Ok, maybe I am dumb here but I am trying to detect if my computer is connected to the network. I spend about 15 minutes going through the docs and I find the System.Windows.Forms.SystemInformation class with Network property. Seems all too easy... I do the following: Dim NetInfo As System.Windows.Forms.SystemInformation If NetInfo.Network = True Then pnlIndicator.BackColor = Color.Green Else pnlIndicator.BackColor = Color.Red End If ...and I figure, heay great, I should get a green panel when I have my net cable plugged in and it should go read when my cable gets unplugged (I placed this code into a timer tic event hander). NOPE. Does not seem to do anything... Anyone have any darn ideas?

      P Offline
      P Offline
      Paul Riley
      wrote on last edited by
      #2

      Mine seems to come up with "true" regardless of the reality as well. Maybe it means "if there's a network card" or "if there's something plugged into the network card, regardless of where it might go"? By the way, this function is static, you could just use: ' Dim removed If SystemInformation.Network Then pnlIndicator.BackColor = Color.Green Else pnlIndicator.BackColor = Color.Red End If Won't solve your problem though. :rolleyes: Paul

      R 1 Reply Last reply
      0
      • P Paul Riley

        Mine seems to come up with "true" regardless of the reality as well. Maybe it means "if there's a network card" or "if there's something plugged into the network card, regardless of where it might go"? By the way, this function is static, you could just use: ' Dim removed If SystemInformation.Network Then pnlIndicator.BackColor = Color.Green Else pnlIndicator.BackColor = Color.Red End If Won't solve your problem though. :rolleyes: Paul

        R Offline
        R Offline
        Ray Cassick
        wrote on last edited by
        #3

        Yeah, looks like it just says 'why yes, you do have a nic' :|

        P A 2 Replies Last reply
        0
        • R Ray Cassick

          Yeah, looks like it just says 'why yes, you do have a nic' :|

          P Offline
          P Offline
          Paul Riley
          wrote on last edited by
          #4

          Just reply "Well duh, I fitted it, you think I don't know it's there? Now is it connected to anything???" :-D;):-D

          1 Reply Last reply
          0
          • R Ray Cassick

            Yeah, looks like it just says 'why yes, you do have a nic' :|

            A Offline
            A Offline
            Anonymous
            wrote on last edited by
            #5

            Actually, what it means is that you have "Networking" installed. Whether it's DHCP, NetBios, etc it will still show true. If you uninstall your Networking protocols, it should return false. I forget where I saw it but there is a way to detect the Network.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups