# 使用 .NET 查看或编辑 PPSX 文件元数据

> C# 源代码，用于编辑或查看 PPSX 格式元数据。

Source: https://products.aspose.com/slides/zh/net/metadata/ppsx/
Updated: 2023-04-25



## 通过 C# 修改 PPSX 属性

使用 Aspose.Slides for .NET，开发人员可以访问和修改内置属性以及自定义属性的值。开发人员可以使用 Presentation 对象公开的 [DocumentProperties](https://reference.aspose.com/slides/net/aspose.slides/documentproperties/) 属性来访问演示文件的文档属性。

### 修改 PPSX 内置属性 - C#

```cs

// Instantiate the Presentation class that represents the Presentation
Presentation presentation = new Presentation("presentation.ppsx");

// Create a reference to IDocumentProperties object associated with Presentation
IDocumentProperties documentProperties = presentation.DocumentProperties;

// Set the builtin properties
documentProperties.Author = "Aspose.Slides for .NET";
documentProperties.Title = "Modifying Presentation Properties";
documentProperties.Subject = "Aspose Subject";
documentProperties.Comments = "Aspose Description";
documentProperties.Manager = "Aspose Manager";

// Save your presentation to a file
presentation.Save("DocumentProperties_out.ppsx", SaveFormat.Ppsx);
```

### 将自定义属性添加到 PPSX - C#

```cs

// Instantiate the Presentation class
Presentation presentation = new Presentation();

// Getting Document Properties
IDocumentProperties documentProperties = presentation.DocumentProperties;

// Adding Custom properties
documentProperties["New Custom"] = 12;
documentProperties["My Name"] = "Aspose Metadata Editor";
documentProperties["Custom"] = 124;

// Getting property name at particular index
String getPropertyName = documentProperties.GetCustomPropertyName(2);

// Removing selected property
documentProperties.RemoveCustomProperty(getPropertyName);

// Save your presentation to a file
presentation.Save("CustomDocumentProperties_out.ppsx", SaveFormat.Ppsx);
```

## 如何通过 C# 提取 PPSX 的元数据

这些是从 PPSX 文件中提取元数据的步骤。

使用 PPSX 文件的路径实例化 Presentation 类

获取与 Presentation 关联的 DocumentProperties 对象

遍历 DocumentProperties 对象中的项目

访问和修改自定义属性

## 其他支持的元数据格式
