private void doItBtn_Click(object sender, EventArgs e) { var minLength = int.Parse(minLengthBox.Text); var lines = File.ReadAllLines(USTFile, Helpers.Shift_JIS); var notesCount = 0; var p3 = ReadVal(p3Box); var v3 = ReadVal(v3Box); var p4 = ReadVal(p4Box); var v4 = ReadVal(v4Box); var p5 = ReadVal(p5Box); var v5 = ReadVal(v5Box); var patcher = new FilePatcher(); lines = patcher.GetLines(lines, minLength, p3, v3, p4, v4, p5, v5, ref notesCount); File.WriteAllLines(USTFile, lines, Encoding.GetEncoding("shift_jis")); MessageBox.Show(string.Format("Modified envelope for {0} note(s).", notesCount)); Close(); }