Can someone please show me the code and/or briefly describe to me how to create a text file and write in it and save it? And also for opening a file to view or edit it? Thanks!
Printable View
Can someone please show me the code and/or briefly describe to me how to create a text file and write in it and save it? And also for opening a file to view or edit it? Thanks!
The details vary depending on exactly what you want to do but the simplest option is to call File.WriteAllText to write a single String to a file, creating it if it doesn't exist or overwriting it if it does. Likewise, File.ReadAllText will read the entire contents of a file into a String, with which you can then do as you like.