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进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。