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. C#
  4. Enable/Disable Local Area Connection

Enable/Disable Local Area Connection

Scheduled Pinned Locked Moved C#
csharpsysadmintutorialquestion
2 Posts 2 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
    Radgar
    wrote on last edited by
    #1

    My application re-configures the network settings (IP, Subnet Mask, Gateway, DNS..) and after that I want to disable and then enable the Local area connection (not the network card), so the connection is refreshed with the new settings without having to restart the computer. Does anybody have any idea on how to do it in C#? Thanks for your time. Radgar "Imagination is more important than knowledge." - Albert Einstein

    D 1 Reply Last reply
    0
    • R Radgar

      My application re-configures the network settings (IP, Subnet Mask, Gateway, DNS..) and after that I want to disable and then enable the Local area connection (not the network card), so the connection is refreshed with the new settings without having to restart the computer. Does anybody have any idea on how to do it in C#? Thanks for your time. Radgar "Imagination is more important than knowledge." - Albert Einstein

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      You don't have to disable/enable to network card to get the settings to refresh. You can make the changes using WMI, but watch the return codes. No matter what method you chose to make those changes, Windows will tell you if the machine has to be restarted for the changes to take effect. Otherwise, in most cases, the changes you make take effect immediately. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

      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