Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
Tags
- delegate
- ADO.NET
- IT관련
- 메소드
- asp.net mvc
- 디자인패턴
- SQL
- 클래스
- 구글
- csv
- 제네릭
- IT 관련
- mvc
- JavaScript
- MSSQL
- jQuery
- cookie
- LINQ
- c#
- It
- XML
- Excel
- ASP.NET
- angularJS
- 동적dom
- di
- Generic
- iframe
- Today
- 762
- Total
- 1,436,520
심재운 블로그
ASP 의 Dictionary 객체 본문
The Dictionary Object
The Dictionary object is used to store information in name/value pairs (referred to as key and item). The Dictionary object might seem similar to Arrays, however, the Dictionary object is a more desirable solution to manipulate related data.
Comparing Dictionaries and Arrays:
- Keys are used to identify the items in a Dictionary object
- You do not have to call ReDim to change the size of the Dictionary object
- When deleting an item from a Dictionary, the remaining items will automatically shift up
- Dictionaries cannot be multidimensional, Arrays can
- Dictionaries have more built-in functions than Arrays
- Dictionaries work better than arrays on accessing random elements frequently
- Dictionaries work better than arrays on locating items by their content
The following example creates a Dictionary object, adds some key/item pairs to it, and retrieves the item value for the key gr:
<% Dim d Set d=Server.CreateObject("Scripting.Dictionary") d.Add "re","Red" d.Add "gr","Green" d.Add "bl","Blue" d.Add "pi","Pink" Response.Write("The value of key gr is: " & d.Item("gr")) %> Output: The value of key gr is: Green |
The Dictionary object's properties and methods are described below:
Properties
Property | Description |
---|---|
CompareMode | Sets or returns the comparison mode for comparing keys in a Dictionary object |
Count | Returns the number of key/item pairs in a Dictionary object |
Item | Sets or returns the value of an item in a Dictionary object |
Key | Sets a new key value for an existing key value in a Dictionary object |
Methods
Method | Description |
---|---|
Add | Adds a new key/item pair to a Dictionary object |
Exists | Returns a Boolean value that indicates whether a specified key exists in the Dictionary object |
Items | Returns an array of all the items in a Dictionary object |
Keys | Returns an array of all the keys in a Dictionary object |
Remove | Removes one specified key/item pair from the Dictionary object |
RemoveAll | Removes all the key/item pairs in the Dictionary object |
'닷넷관련 > ASP' 카테고리의 다른 글
class asp 의 Parameterized queries 알아보기 (0) | 2017.11.20 |
---|---|
ASP - GetRows() 함수로 Recordset (레코드셋) 데이터 가져와서 출력하기 (6) | 2017.04.30 |
ASP 웹개발자 네이밍규칙 (0) | 2010.05.15 |
ASP - Stored Procedure 로 참,거짓 반환하기 (0) | 2010.03.18 |
ASP - BASE64 지원 라이브러리 - Base64 Encoding Library 2.04 (2) | 2009.04.28 |
ASP 의 Dictionary 객체 (0) | 2009.03.22 |
- Tag
- asp, Dictionary
0 Comments