---
title: "在C#中操作文件"
---

第 [Document](https://reference.aspose.com/words/net/aspose.words/document/) 類別在 Aspose.Words 中居中。 它代表了一份文件，並提供各種文件屬性及方法，如儲存或保護該文件。 您使用 **Document** 類作為您要與 Aspose.Words 執行的任何事情的起点：從頭開始創建新文件、打開模板以供 Mail Merge 使用或從文件中獲取不同部分。

**Document**物件包含所有內容和格式、風格、內建與自訂屬性，以及用於mail merge的[MailMerge](https://reference.aspose.com/words/net/aspose.words.mailmerging/mailmerge/)物件。 **Document** 能讓您取得全文或個別部分的所有文字、書籤和表單欄位。

**Document** 包含一組 [Section](https://reference.aspose.com/words/net/aspose.words/section/) 的物件，讓你可以取得特定部分或執行一些操作（例如複製或移動部分）。 **Document**物件可以隨時儲存到檔案或串流，也可以傳送給客戶端瀏覽器。
