有关Hashtable作为参数传递的问题 本帖最后由 happytor 于 2009-07-22 08:28:11 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 private static void display(Hashtable ht) { foreach(DictionaryEntry de in ht) { Console.WriteLine(de.Key); Console.WriteLine(de.Value); } } display(ht); 先找本基础的书看下吧class Program { private static void display(Hashtable ht) { foreach(DictionaryEntry de in ht) { Console.WriteLine(de.Key); Console.WriteLine(de.Value); } } public static void Main(string[] args) { //Console.WriteLine("Hello World!"); Hashtable ht=new Hashtable(); ht.Add("E","e"); ht.Add("A","a"); ht.Add("C","c"); ht.Add("B","b"); display(ht); string s=(string)ht["A"]; if(ht.Contains("E")) Console.WriteLine("the E key exist"); ht.Remove("C"); Console.WriteLine(ht["A"]); ht.Clear(); Console.WriteLine(ht["A"]); Console.Write("Press any key to continue . . . "); Console.ReadKey(true); } }如果前面没加using System.Collections;别忘了加上 private void display(Hashtable ht) { for(DictionaryEntry de in ht) { Console.WriteLine(de.Key); Console.WriteLine(de.Value); } }应该是:private static void display(Hashtable ht) { foreach(DictionaryEntry de in ht) { Console.WriteLine(de.Key); Console.WriteLine(de.Value); } } 如何不等待MessageBox返回值 新手 vs2008+sql2008打包紧急求助 C#怎么反射局域网里面的组件 用C#发送结构体到C++写的服务器上进行密码验证 求SQL备份与恢复的源代码!!!!!!c# 活动数据库技术 ===求教如何实现通过程序读取sql数据库的信息,然后插入acess表中=== C# 如何让Datagridview处于不活动状态 请问能不能不用XSD文件直接用水晶报表显示数据DataSet中的数据啊 如何创建一张背景为透明的GIF图片啊? 用ClearAllPools()有坏处么???? 类似VS clickonce上传时在远程电脑上创建文件夹,需要什么技术
{
foreach(DictionaryEntry de in ht)
{
Console.WriteLine(de.Key);
Console.WriteLine(de.Value);
}
}
display(ht);
{
private static void display(Hashtable ht)
{
foreach(DictionaryEntry de in ht)
{
Console.WriteLine(de.Key);
Console.WriteLine(de.Value);
}
}
public static void Main(string[] args)
{
//Console.WriteLine("Hello World!");
Hashtable ht=new Hashtable();
ht.Add("E","e");
ht.Add("A","a");
ht.Add("C","c");
ht.Add("B","b");
display(ht);
string s=(string)ht["A"];
if(ht.Contains("E"))
Console.WriteLine("the E key exist");
ht.Remove("C");
Console.WriteLine(ht["A"]);
ht.Clear();
Console.WriteLine(ht["A"]);
Console.Write("Press any key to continue . . . ");
Console.ReadKey(true);
}
}如果前面没加
using System.Collections;
别忘了加上
private void display(Hashtable ht)
{
for(DictionaryEntry de in ht)
{
Console.WriteLine(de.Key);
Console.WriteLine(de.Value);
}
}应该是:private static void display(Hashtable ht)
{
foreach(DictionaryEntry de in ht)
{
Console.WriteLine(de.Key);
Console.WriteLine(de.Value);
}
}