title: Set SelectedPath as a variable in FolderBrowserDialog
body: <p>I am trying to set the selected folder in a FolderBrowserDialog control as a variable, so I can use it within another method</p>
  
  <p>The code I have so far is:</p>
  
  <pre><code>  private void button18_Click(object sender, EventArgs e)
          {
              DialogResult result = folderBrowserDialog1.ShowDialog();
              if (result == DialogResult.OK)
              {
                  //
                  // The user selected a folder and pressed the OK button.
                  // We print the number of files found.
                  //
                  string[] files = Directory.GetFiles(folderBrowserDialog1.SelectedPath);
                  MessageBox.Show("Files found: " + files.Length.ToString(), "Message");
              }
          }
  </code></pre>
  
  <p>So I could call the selected folder in the control above in a method like this:</p>
  
  <pre><code>Process.Start("test.exe", &lt;Folder Selection Here&gt; );
  </code></pre>