the given path's format is not supported. c#
<pre><code>OpenFileDialog ofd = new OpenFileDialog();
ofd.Title = "Select Student Picture";
ofd.InitialDirectory = @"C:\Picture";
ofd.Filter = "All Files|*.*|JPEGs|*.jpg";
//ofd.Multiselect = false;
if (ofd.ShowDialog()==DialogResult.OK)
{
    if (ofd.CheckFileExists)
    {
        pbStudent.ImageLocation = ofd.FileName;
        string path = ofd.SafeFileName;
        System.IO.File.Copy(ofd.FileName, "/Resources/SImages/" + lblRNo + ".jpg");
    }
}
</code></pre>

<p>Can some one help me resolve issue with this error message:</p>

<blockquote>
  <p>the given path's format is not supported.</p>
</blockquote>