您好,登錄后才能下訂單哦!
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace an
{
public class CRYSTAL_INFO
{
public static Hashtable INFO = new Hashtable();
static CRYSTAL_INFO()
{
Hashtable hs1 = new Hashtable();
hs1["item_index"] = 12000;
hs1["crystal_type"] = 102;
hs1["sum_count"] = 1000;
hs1["sale_type"] = 1;
INFO[12000] = hs1;
Hashtable hs2 = new Hashtable();
hs2["item_index"] = 12005;
hs2["min_price"] = 200;
hs2["server_day"] = 20;
hs2["sale_type"] = 2;
INFO[12005] = hs2;
}
}
public class ca
{
static void Main(string[] args)
{
Hashtable table = CRYSTAL_INFO.INFO;
//遍歷表的key
foreach (int key in table.Keys)
{
//Console.WriteLine(key);
}
//遍歷表的值
foreach (Hashtable obj in table.Values)
{
Console.WriteLine(obj);
Console.WriteLine("-----------------------------------------");
//遍歷key
foreach (Object v in obj.Keys)
{
Console.WriteLine(v);
}
Console.WriteLine("-----------------------------------------");
//遍歷值
foreach (Object v in obj.Values)
{
Console.WriteLine(v);
}
Console.WriteLine("-----------------------------------------");
}
// foreach (Hashtable obj in menulist.Values)
// DictionaryEntry en = (DictionaryEntry)obj;
// Console.WriteLine(en.Key);
// Console.WriteLine(en.Value);
//Console.WriteLine(key);
//Console.WriteLine(obj.Values);
// Console.WriteLine(obj);
Console.ReadKey();
}
}
}
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。