Try something like this:
public int upload(string SourceFile,string destinationfile)
{
try{
using (WebClient client = new WebClient())
{
client.Credentials = new NetworkCredential("username", "password");
client.UploadFile("ftpaddress" + SourceFile, destinationfile);
}
File.Delete(destinationfile);
return 1;
}
catch(Exception e)
{
MessageBox.Show(e.Message);
return 0;
}
so both exit points have a return.