1 MessageBoxResult dr = MessageBox.Show("是否在"+ConfigHelper.GetAppSetting("SourceDBName") +"库执行sql", "提示", MessageBoxButton.OKCancel, MessageBoxImage.Question); 2 if (dr == MessageBoxResult.OK) 3 { 4 5 }