private int loadSequence(string seqFile) { int err = 0; txtFilename.Text = Path.GetFileName(seqFile); err = seq.ReadSequenceFile(seqFile); MessageBox.Show(this, seq.summary(), "Summary", MessageBoxButtons.OK, MessageBoxIcon.Information); fileName = seqFile; if (err == 0) { btnSaveAs.Enabled = true; if (chkAutoSave.Checked) { int f = 2; string autoSeqPath = utils.DefaultSequencesPath; string autoSeqName = Path.GetFileNameWithoutExtension(fileName); string ext = Path.GetExtension(fileName); string tryFile = autoSeqPath + autoSeqName + " Rewrite" + ext; //while (System.IO.File.Exists(tryFile)) //{ // tryFile = autoSeqPath + autoSeqName + " (" + f.ToString() + ")" + ext; // f++; //} err = SaveSequence(tryFile); } } return(err); }