# 使用 .NET 檢視或編輯 POTM 檔案中繼資料

> 用於檢視或編輯 POTM 中繼資料的 C# 原始程式碼。

Source: https://products.aspose.com/slides/zh-hant/net/metadata/potm/
Updated: 2026-10-25



## 透過 C# 修改 POTM 屬性

透過 [Aspose.Slides for .NET](/slides/zh-hant/net/)，開發人員可以存取和修改簡報的內建屬性與自訂屬性。使用 `Presentation` 物件的 [`DocumentProperties`](https://reference.aspose.com/slides/net/aspose.slides/documentproperties/) 屬性讀取和更新 POTM 中繼資料。

### 修改 POTM 內建屬性 - C#

```cs
using var presentation = new Presentation("presentation.potm");
var documentProperties = presentation.DocumentProperties;

documentProperties.Author = "Aspose.Slides for .NET";
documentProperties.Title = "Modifying Presentation Properties";
documentProperties.Subject = "Aspose Subject";
documentProperties.Comments = "Aspose Description";
documentProperties.Manager = "Aspose Manager";

presentation.Save("DocumentProperties_out.potm", SaveFormat.Potm);
```

### 為 POTM 新增自訂屬性 - C#

```cs
using var presentation = new Presentation();
var documentProperties = presentation.DocumentProperties;

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

var propertyName = documentProperties.GetCustomPropertyName(2);
documentProperties.RemoveCustomProperty(propertyName);

presentation.Save("CustomDocumentProperties_out.potm", SaveFormat.Potm);
```

## 如何在 C# 中檢視或編輯 POTM 中繼資料

依照下列步驟檢視或編輯 POTM 中繼資料。

1. 使用 `Presentation` 載入 POTM 檔案。

1. 從簡報取得 `DocumentProperties` 物件。

1. 讀取或更新 `Author`、`Title` 和 `Subject` 等內建屬性。

1. 使用 `DocumentProperties` 存取和修改自訂屬性。

## 線上檢視和編輯 POTM 中繼資料

免費的 Aspose.Slides Metadata 應用程式以 [Aspose.Slides for .NET](https://products.aspose.com/slides/zh-hant/net/) 建置，與上方程式碼使用的是同一個 API。開啟它，看看 API 能如何處理您自己的 POTM 檔案。

- 在瀏覽器中執行，無需安裝任何軟體。
- 在撰寫程式碼之前，先看看 Aspose.Slides 如何讀寫屬性。
- 檢視和編輯 POTM 檔案的內建屬性與自訂屬性。
- 儲存並下載更新後的檔案。

## 其他支援的中繼資料格式
