// Create a ResXResourceReader for the file items.resx. ResXResourceReader rsxr = new ResXResourceReader("items.resx"); // Create an IDictionaryEnumerator to iterate through the resources. IDictionaryEnumerator id = rsxr.GetEnumerator(); // Iterate through the resources and display the contents to the console. foreach (DictionaryEntry d in rsxr) { Console.WriteLine(d.Key.ToString() + ":\t" + d.Value.ToString()); } //Close the reader. rsxr.Close();
ResXResourceReader rsxr = new ResXResourceReader("items.resx"); // Create an IDictionaryEnumerator to iterate through the resources.
IDictionaryEnumerator id = rsxr.GetEnumerator(); // Iterate through the resources and display the contents to the console.
foreach (DictionaryEntry d in rsxr)
{
Console.WriteLine(d.Key.ToString() + ":\t" + d.Value.ToString());
} //Close the reader.
rsxr.Close();
{
return System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(strname) ;
}
直接
Properties.Resources.*****