-
Feb 21st, 2014, 10:32 PM
#1
Thread Starter
Addicted Member
How to save and load a text file?
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!
-
Feb 21st, 2014, 11:05 PM
#2
Re: How to save and load a text file?
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.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|