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. Control Panel applets

Control Panel applets

Scheduled Pinned Locked Moved C#
csharpsysadminlinuxquestion
3 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.
  • D Offline
    D Offline
    dsovino
    wrote on last edited by
    #1

    Hi, i'm developing an app where i want to detect internet connection status. I have a linked label on a statusbar (where i show if i'm connected or not). On the click event of the label, i have this code: try { System.Diagnostics.Process proc = new System.Diagnostics.Process(); proc.StartInfo.UseShellExecute = false; proc.StartInfo.FileName = "cmd"; proc.StartInfo.Arguments = "rundll32.exe shell32.dll,Control_RunDLL ncpa.cpl,,0"; proc.Start(); //proc.WaitForExit(); } catch { } As you can tell, the idea is to show the Network Connections avaible on the target system. I searched a while for it, and since C# doesn't support Shell, this is supossed to be the way. :doh: I'm just getting the cmd "poped up". It doesn't call the arguments. When I copy/paste the arguments string on cmd, i get the Network Connections window opened, but cmd remains open as well. Is there any other way to call the control panel applets in c#? If not, is there any way that to emulate the "Run..." from Start menu with c#? Thanks for your time fellas. :laugh: daniel sovino

    N 1 Reply Last reply
    0
    • D dsovino

      Hi, i'm developing an app where i want to detect internet connection status. I have a linked label on a statusbar (where i show if i'm connected or not). On the click event of the label, i have this code: try { System.Diagnostics.Process proc = new System.Diagnostics.Process(); proc.StartInfo.UseShellExecute = false; proc.StartInfo.FileName = "cmd"; proc.StartInfo.Arguments = "rundll32.exe shell32.dll,Control_RunDLL ncpa.cpl,,0"; proc.Start(); //proc.WaitForExit(); } catch { } As you can tell, the idea is to show the Network Connections avaible on the target system. I searched a while for it, and since C# doesn't support Shell, this is supossed to be the way. :doh: I'm just getting the cmd "poped up". It doesn't call the arguments. When I copy/paste the arguments string on cmd, i get the Network Connections window opened, but cmd remains open as well. Is there any other way to call the control panel applets in c#? If not, is there any way that to emulate the "Run..." from Start menu with c#? Thanks for your time fellas. :laugh: daniel sovino

      N Offline
      N Offline
      Nader Elshehabi
      wrote on last edited by
      #2

      kiweed wrote:

      since C# doesn't support Shell

      Ummm. Are you sure?:)

      ProcessStartInfo NetworkConnections = new ProcessStartInfo("rundll32.exe", "shell32.dll,Control_RunDLL ncpa.cpl");
      Process.Start(NetworkConnections);

      Regards:rose:

      D 1 Reply Last reply
      0
      • N Nader Elshehabi

        kiweed wrote:

        since C# doesn't support Shell

        Ummm. Are you sure?:)

        ProcessStartInfo NetworkConnections = new ProcessStartInfo("rundll32.exe", "shell32.dll,Control_RunDLL ncpa.cpl");
        Process.Start(NetworkConnections);

        Regards:rose:

        D Offline
        D Offline
        dsovino
        wrote on last edited by
        #3

        simple as that. thanx a lot :laugh: daniel

        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