| Visual Basic Scripting Edition | 語言參考 |
返回一個數(shù)組,其中包含有 Dictionary 對象中的所有項目。
object.Items
object 應為 Dictionary 對象的名稱。
以下代碼舉例說明如何使用 Items 方法:
Function DicDemo Dim a,d,I,s'創(chuàng)建一些變量Set d = CreateObject("Scripting.Dictionary")d.Add "a","Athens"'添加鍵和項目d.Add "b","Belgrade"d.Add "c","Cairo"a = d.Items'獲取項目。For i = 0 To d.Count -1'循環(huán)使用數(shù)組。s = s & a(i) & "<BR>"'創(chuàng)建返回字符串。NextDicDemo = sEnd Function
Add 方法(Dictionary) | Exists 方法 | Keys 方法 | Remove 方法 | RemoveAll 方法
應用于: Dictionary 對象