title: How I can return a path to a string?
body: <p>I want to ask how i can return a path to a string? i'm having this error message</p>
  
  <blockquote>
    <p>'_Default.uploadfile(string,string)': not all code paths return a value</p>
  </blockquote>
  
  <pre><code>private string uploadfile(String filetype, String Uploadfilename)
  {
      String csFileUploadName;
      if (filetype == "FiUptrack")
      {
          csFileUploadName = "C:\\MusicStore\\uploads\\promos\\" + Uploadfilename;
      }
      else
      {
          csFileUploadName = "C:\\MusicStore\\uploads\\images\\" + Uploadfilename;
      }        
  
      try
      {
          FiUptrack.SaveAs(csFileUploadName);
          lblRequired.Text = "Upload status: File uploaded!";
          return csFileUploadName.ToString();
      }
      catch (Exception ex)
      {
          lblRequired.Text = "Upload status: The file could not be uploaded. The following error occured: " + ex.Message;
      }
  }
  </code></pre>
  
  <p>Usage:</p>
  
  <pre><code>  csArtworkupload = uploadfile("Artworkupload", FiUptrack.FileName);
  </code></pre>
  
  <p>csArtworkupload is a string</p>