## GetFileFormat(string) {#getfileformat_1}

获取文件格式。

```csharp
public static FileFormat GetFileFormat(string filePath)
```

| 范围 | 类型 | 描述 |
| --- | --- | --- |
| filePath | String | 文件路径。 |

### 返回值

确定的文件格式。

### 评论

确定的文件格式并不意味着可以加载指定的图像。使用 CanLoad 方法重载之一来确定是否可以加载文件。

### 也可以看看

* enum [FileFormat](../../fileformat/)
* class [Image](../)
* 命名空间 [Aspose.PSD](../../image/)
* 部件 [Aspose.PSD](../../../)

---

## GetFileFormat(Stream) {#getfileformat}

获取文件格式。

```csharp
public static FileFormat GetFileFormat(Stream stream)
```

| 范围 | 类型 | 描述 |
| --- | --- | --- |
| stream | Stream | 流. |

### 返回值

确定的文件格式。

### 评论

确定的文件格式并不意味着可以加载指定的图像。使用 CanLoad 方法重载之一来确定是否可以加载流。

### 也可以看看

* enum [FileFormat](../../fileformat/)
* class [Image](../)
* 命名空间 [Aspose.PSD](../../image/)
* 部件 [Aspose.PSD](../../../)


