This example writes a string to a text file using the WriteLine method of the StreamWriter class.
This example requires:
A reference to System namespace. The following conditions may cause an exception:
The file exists and is read-only (IOException Class). The disk is full (IOException Class). The pathname is too long (PathTooLongException Class). Access Control). If the file already exists, the application needs only Write access, a lesser privilege. Where possible, it is more secure to create the file during deployment, and only grant Read access to a single file, rather than Create access for a folder.