Errors.Count 属性

定义

获取集合中包含的对象数 ErrorObject 的计数。

public:
 property int Count { int get(); };
public int Count { get; }
member this.Count : int
Public ReadOnly Property Count As Integer

属性值

示例

在以下示例中,Count 属性用于对 Error 对象的集合进行迭代,并显示一个消息框,指示每个错误的短错误消息:

for (int i=0; i &lt; thisXDocument.Errors.<span class="label">Count</span>; i++)
{
 thisXDocument.UI.Alert("Error message: " + thisXDocument.Errors[i].ShortErrorMessage);
}

注解

重要说明:可以不受限制地访问此成员。

适用于