title: How can I determine if the first or third Wednesday of the month has yet to arrive, and if so, which one is nearest to the current date?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/11061174/getting-specific-days-in-a-month">Getting specific days in a month</a>  </p>
  </blockquote>
  
  
  
  <p>I've touched on this problem once before, in <a href="https://stackoverflow.com/questions/5421972/how-to-find-the-3rd-friday-in-a-month-with-c">How to find the 3rd Friday in a month with C#?</a> But since I did not explain my problem well then, I must try again:</p>
  
  <p>My goal here is simple: upon the press of a button (referred to here as "Button1"), I must determine whether today's date is prior to <em>either</em> the first, or the third Wednesday of the month. If this is the case, I must then set the text of a label (referred to here as "lblDate") to the date of whichever of these future Wednesdays is nearest to the current date.</p>
  
  <p>So far, I've written this: </p>
  
  <pre><code>protected void Button1_Click(object sender, EventArgs e)
  {
  
      DateTime Now = DateTime.Today;
      DateTime TempDate = new DateTime(Now.Year, Now.Month, 1);
  
      if (TempDate.DayOfWeek != DayOfWeek.Wednesday)
      {
          TempDate = TempDate.AddDays(1);
          string date = TempDate.ToString();
          lblDate.Text = date;
      }
      if (TempDate == TempDate.AddDays(1))
      {
          TempDate = TempDate.AddDays(14);
          string date = TempDate.ToString();
          lblDate.Text = date;
      }
  
  }
  </code></pre>
  
  <p>As you can see, something is missing. I would greatly appreciate any assistance in filling that in...</p>