How to avoid of file name validation in SaveFileDialog C#

╄→尐↘猪︶ㄣ 提交于 2020-01-01 06:12:07

问题


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?

来源:https://stackoverflow.com/questions/22667972/how-to-avoid-of-file-name-validation-in-savefiledialog-c-sharp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!