+ 2
Error With SaveFileDialog And StreamReader? (C#)
I have A error,I want the streamwriter to write that textlines into the savefiledialog file path (savefiledialog.filename), It doesnt mark me any error,but when my app runs and I try to save the file,my app stops and say "Exception Unhandled. System.ArgumentException. Can´t leave void the name of file path"
2 Antworten
+ 2
This Is My Code
SaveFileDialog savefiledialog1=new SaveFileDialog(){ Filter="Analytica Files|*.analy",AddExtension=true};if (savefiledialog1.ShowDialog()== DialogResult.OK){using(Stream s= File.Open(savefiledialog1.FileName, FileMode.CreateNew))
using((s)){
var path= saveFileDialog1.FileName;
TaskData.file=new StreamWriter(path);
TaskData.File.Write(TitleBox.Text;)
+ 1
c# is case sensitive
SaveFileDialog savefiledialog1=new SaveFileDialog()
var path= saveFileDialog1.FileName;
savefiledialog1 is not saveFileDialog1