نمایش مقادیر Hashtable با IDictionaryEnumerator و استفاده از کلید/مقدار در #C
سلام بر تمامی برنامه نویسان سی شارپ 😉 در این مطلب ، نمایش مقادیر Hashtable با IDictionaryEnumerator و استفاده از کلید/مقدار در سی شارپ #C رو براتون آماده کردم. انشاالله که این کد براتون مفید باشه.
خروجی پروژه به این صورت می باشد:
Display info using Entry.
A: 3
B: 9
C: 3
D: 7
Display info using Key and Value directly.
A: 3
B: 9
C: 3
D: 7
A: 3
B: 9
C: 3
D: 7
Display info using Key and Value directly.
A: 3
B: 9
C: 3
D: 7
نمایش مقادیر Hashtable با IDictionaryEnumerator و استفاده از کلید/مقدار :
using System;
using System.Collections;
class MainClass {
public static void Main() {
// Create a hash table.
Hashtable ht = new Hashtable();
// Add elements to the table
ht.Add("A", "3");
ht.Add("B", "9");
ht.Add("C", "3");
ht.Add("D", "7");
// Demonstrate enumerator
using System.Collections;
class MainClass {
public static void Main() {
// Create a hash table.
Hashtable ht = new Hashtable();
// Add elements to the table
ht.Add("A", "3");
ht.Add("B", "9");
ht.Add("C", "3");
ht.Add("D", "7");
// Demonstrate enumerator