1
Answer

SaveFileDialog with c#

kobycool68

kobycool68

20y
1.9k
1
hello, i have a form with many parameters. among others i have a menu item "File" that contain 'open...' and 'Save...' when i choose the 'Save...' option i want to save all my operation so far(it`s mean that if i change any parameter or any control). and when i do open to this file i want to see all !! my changes. /////////////////////////////// for exampl: in my form i have a TextBox, suppose i write anything in the text box and i save it, now i`m close all, init my program again and use 'open' option - now, i want to see my changes in the text box. /////////////////////////////// my 'SaveFileDialog' function look like this: this.saveFileDialog = new SaveFileDialog(); this.saveFileDialog.DefaultExt = "mddb"; this.saveFileDialog.Filter = "MDDB files (*.mddb)|*.mddb|All files (*.*)|*.*" ; this.saveFileDialog.FilterIndex = 2 ; this.saveFileDialog.RestoreDirectory = true ; if(saveFileDialog.ShowDialog() == DialogResult.OK) { if((myStream = saveFileDialog.OpenFile()) != null) { ???? myStream.Close(); } } ? - means mabye there my problem thank you in advanced koby
Answers (1)
0
compuwiz02
NA 9 0 20y
You are indeed correct about the placement of the error. The question marks should be replaced with a piece of code that writes to the mystream. As i have noticed, you have not really declared myStream in the portion of the code that you left us. What is the datatype of myStream? If it is of type stream, then the solution to the problem lies in the Methods that are embeded into the stream Class.