## Directory::Delete method


删除指定的文件或目录。不会抛出异常。

```cpp
static void System::IO::Directory::Delete(const String &path, bool recursive=false)
```


| Parameter | Type | 描述 |
| --- | --- | --- |
| 路径 | const String\& | 要删除的目录或文件的路径 |
| 递归 | bool | 如果 **path** 指定的是非空目录，则 **recursive** 指定是否应递归删除目录的所有内容；如果 **path** 指定的目录非空且 **recursive** 为 'false'，则操作失败 |

## 另见

* Class [String](../../../system/string/)
* Class [Directory](../)
* Namespace [System::IO](../../)
* Library [Aspose.Page for C++](../../../)
