## DocumentProperty class

表示自定义或内置文档属性。

```csharp
public class DocumentProperty
```

## 特性

| 姓名 | 描述 |
| --- | --- |
| [IsGeneratedName](../../aspose.cells.properties/documentproperty/isgeneratedname) { get; } | 如果此属性在 OLE2 存储 中没有名称并且仅为公共 API 生成唯一名称，则返回 true。 |
| [IsLinkedToContent](../../aspose.cells.properties/documentproperty/islinkedtocontent) { get; } | 指示此属性是否链接到 content |
| [Name](../../aspose.cells.properties/documentproperty/name) { get; } | 返回属性的名称。 |
| [Source](../../aspose.cells.properties/documentproperty/source) { get; } | 链接的内容来源。 |
| [Type](../../aspose.cells.properties/documentproperty/type) { get; } | 获取属性的数据类型。 |
| [Value](../../aspose.cells.properties/documentproperty/value) { get; set; } | 获取或设置属性的值。 |

## 方法

| 姓名 | 描述 |
| --- | --- |
| [ToBool](../../aspose.cells.properties/documentproperty/tobool)() | 将属性值返回为布尔值。 |
| [ToDateTime](../../aspose.cells.properties/documentproperty/todatetime)() | 以本地时区的 DateTime 形式返回属性值。 |
| [ToDouble](../../aspose.cells.properties/documentproperty/todouble)() | 以 double 形式返回属性值。 |
| [ToInt](../../aspose.cells.properties/documentproperty/toint)() | 以整数形式返回属性值。 |
| override [ToString](../../aspose.cells.properties/documentproperty/tostring)() | 以字符串形式返回属性值。 |

### 例子

```csharp

[C#]

//实例化一个工作簿对象
Workbook workbook = new Workbook("book1.xls");
 
//检索Excel文件的所有自定义文档属性的列表
DocumentPropertyCollection customProperties = workbook.Worksheets.CustomDocumentProperties;
 
//使用属性索引访问自定义文档属性
DocumentProperty customProperty1 = customProperties[3];
 
//使用属性名称访问自定义文档属性
DocumentProperty customProperty2 = customProperties["Owner"];

[VB.NET]

'实例化工作簿对象
Dim workbook As Workbook = New Workbook("book1.xls")
 
'检索 Excel 文件的所有自定义文档属性的列表
Dim customProperties As DocumentPropertyCollection = workbook.Worksheets.CustomDocumentProperties
 
'使用属性索引访问自定义文档属性
Dim customProperty1 As DocumentProperty = customProperties(3)
 
'使用属性名称访问自定义文档属性
Dim customProperty2 As DocumentProperty = customProperties("Owner")
```

### 也可以看看

* 命名空间 [Aspose.Cells.Properties](../../aspose.cells.properties)
* 部件 [Aspose.Cells](../../)

<!-- DO NOT EDIT: generated by xmldocmd for Aspose.Cells.dll -->
