save & open file...
-
good morning ..every one ! ok..i wanna to make aprograme that can draw(ellipse,lines,..) but i have aproblems with saving & opening file ..my save code is: FileStream outStream=File.Create(saveFileDialog1.FileName);//To create text file StreamWriter streamWriter=new StreamWriter(outStream); the error...>>(cannot implicity convert type 'System.IO.StreamWritet'to 'System.IO.Stream'. plzz send me back...as fast as u can Regards;:)
-
good morning ..every one ! ok..i wanna to make aprograme that can draw(ellipse,lines,..) but i have aproblems with saving & opening file ..my save code is: FileStream outStream=File.Create(saveFileDialog1.FileName);//To create text file StreamWriter streamWriter=new StreamWriter(outStream); the error...>>(cannot implicity convert type 'System.IO.StreamWritet'to 'System.IO.Stream'. plzz send me back...as fast as u can Regards;:)
mr jets wrote:
as fast as u can
I recommend not saying things like this when asking for free advice. System.IO.File.WriteAllLines or System.IO.File.WriteAllText are the easiest way to create a text file. Having said that, your code compiles just fine here. What line gives the error ?
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
mr jets wrote:
as fast as u can
I recommend not saying things like this when asking for free advice. System.IO.File.WriteAllLines or System.IO.File.WriteAllText are the easiest way to create a text file. Having said that, your code compiles just fine here. What line gives the error ?
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
ok frist of all ..iam sorry bout my behavior but save & open its apart of very very huge program ..the dead line after 5 hours..so thank god i didnt kill my some one .. ok the error at ...: StreamWriter streamWriter=new StreamWriter(outStream); plzz if u know more simple code..i will invite u to cinema..kidding!!:omg:
-
ok frist of all ..iam sorry bout my behavior but save & open its apart of very very huge program ..the dead line after 5 hours..so thank god i didnt kill my some one .. ok the error at ...: StreamWriter streamWriter=new StreamWriter(outStream); plzz if u know more simple code..i will invite u to cinema..kidding!!:omg:
Building the string and using WriteAllText is definately simpler. I don't get the error, because, like I said, it compiled fine here.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
Building the string and using WriteAllText is definately simpler. I don't get the error, because, like I said, it compiled fine here.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
Building the string and using WriteAllText is definately simpler. I don't get the error, because, like I said, it compiled fine here.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
ok i give up ..i really need ur help bro..its apart of my code..where is the wrong ?! using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.IO; using System.Runtime.Serialization.Formatters.Binary; using System.Runtime.Serialization; namespace graphics_practis { /// /// Summary description for Form1. /// public class Form1 : System.Windows.Forms.Form { private System.Windows.Forms.Panel panel1; private System.Windows.Forms.PictureBox pictureBox1; private System.Windows.Forms.Button line; private System.Windows.Forms.Button square; private System.Windows.Forms.Button circle; private System.Windows.Forms.Button ellipse; private System.Windows.Forms.Button polygon; private System.Windows.Forms.TextBox textBox1; private System.Windows.Forms.Button ok; private System.Windows.Forms.MainMenu mainMenu1; private System.Windows.Forms.MenuItem menuItem1; private System.Windows.Forms.MenuItem menuItem2; private System.Windows.Forms.MenuItem menuItem3; private System.Windows.Forms.MenuItem menuItem4; private System.Windows.Forms.MenuItem menuItem5; private BinaryFormatter formtter = new BinaryFormatter(); private FileStream str_reader; private System.Windows.Forms.Button button1; private System.Windows.Forms.Button button2; private System.Windows.Forms.SaveFileDialog saveFileDialog1; private System.Windows.Forms.OpenFileDialog openFileDialog1; /// /// Required designer variable. /// private System.ComponentModel.Container components = null; public Form1() { // // Required for Windows Form Designer support // InitializeComponent(); // // TODO: Add any constructor code after InitializeComponent call // dr = new draw(this.pictureBox1); } static void Main() { Application.Run(new Form1()); } private void menuItem4_Click(object sender, System.EventArgs e) { //saving FileStream outStream=File.Create(saveFileDialog1.FileName);//To create text file Stream streamWriter=new StreamWriter(outStream); } private void menuItem3_Click(object sender, System.EventArgs e) { //opening FileStream outStream=File.Create(saveFileDialog1.FileName);//To create text file StreamWriter streamWriter=new StreamWriter(outStream); }