How to avoid of file name validation in SaveFileDi

2019-03-30 13:20发布

问题:

Is it possible to avoid of fileName validation in SaveFileDialog?

  var saveFileDialog = new SaveFileDialog {
Filter = "Job package (*.job)|*.job", 
CheckPathExists = false,
 ValidateNames = false };

 var result = saveFileDialog.ShowDialog();
        if (result.Value)
        {

           ....my own validation....
        }

The ValidateNames property doesn't work. Anyway, when I type a name with invalid characters, the dialog shows it's own popup "The file name is not valid". Can I avoid it? How?