c# - Bypassing save dialog box in WPF application -


i trying bypass save dialog box when using savefiledialog class. want able write document without having prompt user decide if want save or not, file should automatically save when click button.

 savefiledialog savefiledialog1 = new savefiledialog();   savefiledialog1.filter = "txt files (*.txt)|*.txt|all files (*.*)|*.*"  ;  savefiledialog1.restoredirectory = true ;  savefiledialog1.initialdirectory = @"c:\";  if(savefiledialog1.showdialog() == dialogresult.ok)  {      // code write stream goes here.  } 

i have tried removing if statement using...

savefiledialog1.createprompt = false; 

nothing seems work... ideas?

i think want bypass overwrite prompt dialog.

in case can use

savefiledialog1.overwriteprompt = false; 

otherwise, don't need savefiledialog , can save stream without using it.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -