给你个例子,读取文件到哈希表 Hashtable freshDatas = new Hashtable(); StreamReader oriReader = new StreamReader("11.txt"); string tmpContent = oriReader.ReadToEnd(); oriReader.Close();
不知道楼主建HashTable的目的是什么... DataTable dt = new DataTAble(); HashTable ht = new HashTable();foreach( dataRow dr in dt ) { ht.Add(dr["链接"], "... ..."); }
public static class HATable { private static Hashtable _aaa; public static Hashtable AAA { get { if (_aaa== null) {//5 _aaa= new Hashtable(); _aaa.Add("测试", "111111");
StreamReader oriReader = new StreamReader("11.txt");
string tmpContent = oriReader.ReadToEnd();
oriReader.Close();
DataTable dt = new DataTAble();
HashTable ht = new HashTable();foreach( dataRow dr in dt )
{
ht.Add(dr["链接"], "... ...");
}
{
private static Hashtable _aaa; public static Hashtable AAA
{
get
{
if (_aaa== null)
{//5
_aaa= new Hashtable();
_aaa.Add("测试", "111111");