private static Hashtable GetResource()
{
String projectName = Assembly.GetExecutingAssembly().GetName().Name.ToString();
System.IO.Stream xmlStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(projectName + ".a.xml");//需要修改a.xml属性: 嵌入的资源
DataSet ds = new DataSet();
ds.ReadXml(xmlStream);
Hashtable ht = new Hashtable();
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
ht.Add(ds.Tables[0].Rows[i][1], ds.Tables[0].Rows[i][0]);
}
return ht;
{
String projectName = Assembly.GetExecutingAssembly().GetName().Name.ToString();
System.IO.Stream xmlStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(projectName + ".a.xml");//需要修改a.xml属性: 嵌入的资源
DataSet ds = new DataSet();
ds.ReadXml(xmlStream);
Hashtable ht = new Hashtable();
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
ht.Add(ds.Tables[0].Rows[i][1], ds.Tables[0].Rows[i][0]);
}
return ht;
}