Database Reference
In-Depth Information
19. Save the changes and build the application. You should see the message “Build
Succeeded.” Now it's time to run the application and do a file read-write
operation. Press Ctrl+F5 to run the program.
Note It is important to understand that System.IO can read or write only those files with either a .txt or .log
file extension. Also, such file-handling programs are based on a file path and file name. For demonstration
purposes, I am using my laptop-specific path and a file name. These file paths and file names will not match
what's on your system, so please modify the names of the directory and file name accordingly.
20. When the application launches, enter the file path in the first text box and then
type the text you want to save in this file, as shown in Figure 11-2.
Note It is important to use the path of the file read and write as per your computer; also, make sure you have
write permission to the specified drive/folder.
Figure 11-2. File write operation in action
21. Once you're done, click the Write To File button. You should be able to see
your file created, as shown in Figure 11-3.
 
Search WWH ::




Custom Search