title: C# run same MessageBox 2 time in Timer Tick
body: <p>I read time from php with C#. I have to show MessageBox before Logoff windows when the time is equal. But when I run program it show same MessageBox 2 time. I want to show MessageBox 1 time only before Logoff. I set Interval is 30,000. How to do it? This is my code</p>
  
  <pre><code>        private void timer1_Tick(object sender, EventArgs e)
          {
              bool showingBox = false;
              timer1.Start();
              WebClient client = new WebClient();
              Stream stream = client.OpenRead("http://172.22.22.20/time.php");
              StreamReader reader = new StreamReader(stream);
              String content = reader.ReadToEnd();
              //textBox1.Text = content;
  
              if (showingBox) return;
              showingBox = true;
              try
              {
  
                  if (content == "08:00")
                  {
  
                      MessageBox.Show(new Form() { TopMost = true }, "11111");  // This will show 2 Message Box when time = 08.00
  
                  }
              }
              finally
              {
                  showingBox = false;
              }
  
              if (content == "08:05")
              {
  
                  ExitWindowsEx(4, 0);
  
              }
  
              timer1.Enabled = false;
          }
  
          }
  
      }
  </code></pre>