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. Other Discussions
  3. Clever Code
  4. To Shutdown or Not to Shutdown.. that is the Question.

To Shutdown or Not to Shutdown.. that is the Question.

Scheduled Pinned Locked Moved Clever Code
testingbeta-testingquestion
8 Posts 6 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.
  • P Offline
    P Offline
    PhilDanger
    wrote on last edited by
    #1

    I was testing a little application that monitors battery voltage that is sent to a robot's logic board. I had whipped up a little test form to test the shutdown process in Windows.

    btnShutdown_Click(object sender, EventArgs e){
        Process.Start("shutdown", "-s -t 30 -c \"Battery Voltage is at a critical level, shutting down.\"");
    }
    

    When I'd click the shutdown button, a duplicate form would appear instead of shutting down! After debugging for a few minutes to see that the Process.Start actually was being called, I realized my mistake -- I had called my test application "Shutdown".

    D R G V L 5 Replies Last reply
    0
    • P PhilDanger

      I was testing a little application that monitors battery voltage that is sent to a robot's logic board. I had whipped up a little test form to test the shutdown process in Windows.

      btnShutdown_Click(object sender, EventArgs e){
          Process.Start("shutdown", "-s -t 30 -c \"Battery Voltage is at a critical level, shutting down.\"");
      }
      

      When I'd click the shutdown button, a duplicate form would appear instead of shutting down! After debugging for a few minutes to see that the Process.Start actually was being called, I realized my mistake -- I had called my test application "Shutdown".

      D Offline
      D Offline
      dighn
      wrote on last edited by
      #2

      that's a funny one :D thanks for the laugh

      1 Reply Last reply
      0
      • P PhilDanger

        I was testing a little application that monitors battery voltage that is sent to a robot's logic board. I had whipped up a little test form to test the shutdown process in Windows.

        btnShutdown_Click(object sender, EventArgs e){
            Process.Start("shutdown", "-s -t 30 -c \"Battery Voltage is at a critical level, shutting down.\"");
        }
        

        When I'd click the shutdown button, a duplicate form would appear instead of shutting down! After debugging for a few minutes to see that the Process.Start actually was being called, I realized my mistake -- I had called my test application "Shutdown".

        R Offline
        R Offline
        Rage
        wrote on last edited by
        #3

        Excellent !

        Don't follow any man spiritually, don't do anything that will get you in sh*t if god is real - Bradml[^]

        1 Reply Last reply
        0
        • P PhilDanger

          I was testing a little application that monitors battery voltage that is sent to a robot's logic board. I had whipped up a little test form to test the shutdown process in Windows.

          btnShutdown_Click(object sender, EventArgs e){
              Process.Start("shutdown", "-s -t 30 -c \"Battery Voltage is at a critical level, shutting down.\"");
          }
          

          When I'd click the shutdown button, a duplicate form would appear instead of shutting down! After debugging for a few minutes to see that the Process.Start actually was being called, I realized my mistake -- I had called my test application "Shutdown".

          G Offline
          G Offline
          Giorgi Dalakishvili
          wrote on last edited by
          #4

          It's very interesting. Why don't you use this[^] to shutdown Windows?

          #region signature my articles #endregion

          P 1 Reply Last reply
          0
          • G Giorgi Dalakishvili

            It's very interesting. Why don't you use this[^] to shutdown Windows?

            #region signature my articles #endregion

            P Offline
            P Offline
            PhilDanger
            wrote on last edited by
            #5

            Giorgi Dalakishvili wrote:

            It's very interesting. Why don't you use this[^] to shutdown Windows?

            Because the Windows shutdown works for me.

            G 1 Reply Last reply
            0
            • P PhilDanger

              Giorgi Dalakishvili wrote:

              It's very interesting. Why don't you use this[^] to shutdown Windows?

              Because the Windows shutdown works for me.

              G Offline
              G Offline
              Giorgi Dalakishvili
              wrote on last edited by
              #6

              But introduced this bug :D

              #region signature my articles #endregion

              1 Reply Last reply
              0
              • P PhilDanger

                I was testing a little application that monitors battery voltage that is sent to a robot's logic board. I had whipped up a little test form to test the shutdown process in Windows.

                btnShutdown_Click(object sender, EventArgs e){
                    Process.Start("shutdown", "-s -t 30 -c \"Battery Voltage is at a critical level, shutting down.\"");
                }
                

                When I'd click the shutdown button, a duplicate form would appear instead of shutting down! After debugging for a few minutes to see that the Process.Start actually was being called, I realized my mistake -- I had called my test application "Shutdown".

                V Offline
                V Offline
                Vasudevan Deepak Kumar
                wrote on last edited by
                #7

                PhilDanger wrote:

                duplicate form would appear instead of shutting down

                Did you mean the 'Shutdown' Countdown Timer dialog?

                Vasudevan Deepak Kumar Personal Homepage Tech Gossips

                1 Reply Last reply
                0
                • P PhilDanger

                  I was testing a little application that monitors battery voltage that is sent to a robot's logic board. I had whipped up a little test form to test the shutdown process in Windows.

                  btnShutdown_Click(object sender, EventArgs e){
                      Process.Start("shutdown", "-s -t 30 -c \"Battery Voltage is at a critical level, shutting down.\"");
                  }
                  

                  When I'd click the shutdown button, a duplicate form would appear instead of shutting down! After debugging for a few minutes to see that the Process.Start actually was being called, I realized my mistake -- I had called my test application "Shutdown".

                  L Offline
                  L Offline
                  Lju2
                  wrote on last edited by
                  #8

                  Exactly the same happened to me, when I named my .bat file shutdown.bat :) and was calling shutdown from that file causing an infinite loop

                  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