title: C#:Saving image to folder
body: <p>HI. I know this is simple question but when I use </p>
  
  <pre><code> FirstPersonTestImage.Save(IIdComboBox.Text + "-" + i + ".jpg");
  </code></pre>
  
  <p>it works and saves file to folder where is the .exe file . But I want to save it to specific folder like  /photo/IO-66/  and tryed to use </p>
  
  <pre><code> String StudentPath = PhotoPath + IGroupNoComboBox.Text + "/" + IIdComboBox.Text + "/" + IIdComboBox.Text + "-" + i + ".jpg";
  
   FirstPersonTestImage.Save(StudentPath);
  </code></pre>
  
  <p>BUt it gives </p>
  
  <pre><code>An unhandled exception of type 'System.Runtime.InteropServices.ExternalException' occurred in System.Drawing.dll
  </code></pre>
  
  <p>How can I solve this problem? Is is about folder path ? or using  "/" ?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Here My code for creating and checking existing or not folder </p>
  
  <pre><code>  if (!System.IO.Directory.Exists(PhotoPath + "/" + IGroupNoComboBox.Text.ToString().Trim()))
              {
  
                 Directory.CreateDirectory(PhotoPath + "/" + IGroupNoComboBox.Text.ToString().Trim());
  
  
              }
  
               if (!System.IO.Directory.Exists(PhotoPath + "/" + IGroupNoComboBox.Text.ToString().Trim()+ "/" + IIdComboBox.Text.ToString().Trim() + "/"))
              {
  
                  Directory.CreateDirectory(PhotoPath + "/" + IGroupNoComboBox.Text.ToString().Trim()+"/" + IIdComboBox.Text.ToString().Trim() + "/");
  
              }
  </code></pre>