IEditorOperations::InsertFile Method (String^)
Inserts the contents of a file on disk into the text buffer.
Assembly: Microsoft.VisualStudio.Text.UI (in Microsoft.VisualStudio.Text.UI.dll)
Parameters
- filePath
-
Type:
System::String^
The path of the file on disk.
| Exception | Condition |
|---|---|
| DirectoryNotFoundException | The specified path is invalid (for example, it is on an unmapped drive). |
| ArgumentException | filePath is a zero-length string, contains only white space, or contains one or more invalid characters as defined by GetInvalidPathChars. |
| FileNotFoundException | The file specified in filePath was not found. |
| SecurityException | The caller does not have the required permission. |
| PathTooLongException | The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. |
| UnauthorizedAccessException | filePath specifies a file that is read-only, or this operation is not supported on the current platform, or filePath specifies a directory, or the caller does not have the required permission. |
| IOException | An I/O error occurred while opening the file. |
| ArgumentNullException | filePath is null. |
| NotSupportedException | filePath is in an invalid format. |