Assembly assm = this.GetType().Assembly;//Assembly.LoadFrom(程序集路径);
foreach (string resName in assm.GetManifestResourceNames())
{
Stream stream = assm.GetManifestResourceStream(resName);
ResourceReader rr = new ResourceReader(stream);
IDictionaryEnumerator enumerator = rr.GetEnumerator();
while (enumerator.MoveNext())
{
DictionaryEntry de = (DictionaryEntry)enumerator.Current;
MessageBox.Show(de.Key + ":" + de.Value);//是资源名
//是资源内容
}
}
时间: 2024-10-14 08:17:45