|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.|
How to: Create a File in Visual Basic
If the file already exists, it is replaced.
The following conditions may cause an exception:
The path name is malformed. For example, it contains illegal characters or is only white space (ArgumentException).
The path is read-only (IOException).
The path name is Nothing (ArgumentNullException).
The path name is too long (PathTooLongException).
The path is invalid (DirectoryNotFoundException).
The path is only a colon ":" (NotSupportedException).