I want to do something like this:
.
.
if(ShowDialog(MessageBox.Show("File already Exists, do you want to overwirte the existing file?","File Overwrite???", MessageBoxButtons.YesNo))=="Yes")
.
.
MessageBox says: The file already exists" Do you want to overwite? Yes/No. and if user presses Yes then the process should overwrite the file otherwise... exits.

1 answers
Like this perhaps:
DialogResult dr = MessageBox.Show("File already Exists, do you want to overwirte the existing file?","File Overwrite???", MessageBoxButtons.YesNo);if (dr == DialogResult.Yes)
{
// code to overwrite file
}
answered one year ago by:
17279