PersonalizationStateInfoCollection.Count 属性
定义
获取集合中项的数目。Gets the number of items in a collection.
public:
property int Count { int get(); };
public int Count { get; }
member this.Count : int
Public ReadOnly Property Count As Integer
属性值
集合中的项数。The number of items in a collection.
实现
示例
下面的代码示例演示如何使用 Count 属性。The following code example demonstrates how to use the Count property.
PersonalizationStateInfoCollection findresult;
findresult = PersonalizationAdministration.FindUserState(null, TextBox3.Text);
if (findresult.Count != 0)
{
Label4.Text = findresult.Count + " user(s) found";
Label4.Visible = true;
}
注解
集合中项的计数可用于循环访问集合,如示例中所示。The count of the items in the collection can be used to iterate through the collection, as shown in the example.