title: Getting a System.StackOverflowException' error
body: <p>I am Getting this error <em>An unhandled exception of type 'System.StackOverflowException' occurred in mscorlib.dll</em> I know you are not supposed to have an infinite loop but its not an infinate loop because it just has too go till it gets a file number that has not been made yet. How can i go about this a better way?</p>
  
  <pre><code>private int x = 0;
  public string clients = @"F:\Internal Jobs\Therm-Air Files\Program\P-1-2.0\Clients\";
  public string tdate = DateTime.Today.ToString("MM-dd-yy");
  
  public void saveloop()
  {
      string path = LoadPO.Text.Substring(0, LoadPO.Text.LastIndexOf("\\"));
      string name = Path.GetFileName(path);
      string t = Convert.ToString(x);
  
      if (!File.Exists(path + @"\" + name + ".xlsx")) // This Line throws error
      {
          oSheet.SaveAs(path + @"\" + name + "-" + t + ".xlsx");
          string prop = /* snipped for space reasons, just string concats */
  
          string Combine = string.Empty;
          int b = 0;
          int c = cf.cPanel.Controls.Count;
          string[] items = new string[c];
          foreach (WProduct ewp in cf.cPanel.Controls)
          {
              string item = /* snipped for space reasons, just string concats */
              items[b] = item;
              b += 1;
          }
          Combine = prop + "^&lt;";
          foreach (var strings in items)
          {
              Combine += strings + "&lt;";
          }
  
          File.WriteAllText(path + @"\" + name + ".txt", Combine);
      }
      else
      {
          x += 1;
          saveloop();
  
      }
  </code></pre>