private void button2_Click(object sender, EventArgs e) { if (checkBox1.Checked == true) { CertUtils.SignFile(textBox1.Text, textBox2.Text, true); } else { CertUtils.SignFile(textBox1.Text, textBox2.Text, false); } MessageBox.Show("done"); }