Hello, does anyone know how to load contents of a file into a multilined TextBox in net 2.0 compact framework and, after editing save it back to a file (the same or with changed name)?
I'm a newbee in C# programming :(
Greetings
Hello, does anyone know how to load contents of a file into a multilined TextBox in net 2.0 compact framework and, after editing save it back to a file (the same or with changed name)?
I'm a newbee in C# programming :(
Greetings
Should be just this simple:
// read:
MyTextBox.Text = System.IO.File.ReadAllText("some_file.txt");
// write:
System.IO.File.WriteAllText("some_other_file.txt", MyTextBox.Text);
Though you will want to do some exception handling in your production version. But these two lines of code are your bread and butter.
P.S. Most things that you get to do with the full .NET framework also work in the compact edition. So when you're searching for the "how to", never mind looking compact-specific code at first. Just try the standard .NET offerings.