## File::CreateText method


创建一个新文件或打开已有文件，以写入 UTF-8 编码的文本。

```cpp
static StreamWriterPtr System::IO::File::CreateText(const String &path)
```


| 参数 | 类型 | 描述 |
| --- | --- | --- |
| 路径 | const String\& | 要创建或打开的文件路径 |

### ReturnValue

指向与指定文件关联的 [StreamWriter](../../streamwriter/) 对象的共享指针

## 另见

* Typedef [StreamWriterPtr](../../../system/streamwriterptr/)
* Class [String](../../../system/string/)
* Class [File](../)
* Namespace [System::IO](../../)
* Library [Aspose.Font for C++](../../../)
