title: how to use try catch blocks in a value returning method?
body: <p>I am checking the uploaded image in a registration form , where i need to use try catch blocks. here is my code:</p>
  
  <pre><code>public bool CheckFileType(string FileName)
  {
          string Ext = Path.GetExtension(FileName);
          switch (Ext.ToLower())
          {
              case ".gif":                   
                  return true;
                  break;
              case ".JPEG":                    
                  return true;
                  break;
              case ".jpg":                  
                  return true;
                  break;
              case ".png":                   
                  return true;
                  break;
              case ".bmp":                   
                  return true;
                  break;
              default:                  
                  return false;
                  break;
          }
  
  }
  </code></pre>
  
  <p>please suggest me how to use the try catch blocks here.</p>
  
  <p>thanks in advance.</p>