Code: Finding the Names of Resources in an Assembly (Visual C#)
The document is archived and information here might be outdated

Code: Finding the Names of Resources in an Assembly (Visual C#)

Visual Studio .NET 2003

This example creates a string that contains the names of all the resources in an assembly.

Example

System.Reflection.Assembly thisExe; 
thisExe = System.Reflection.Assembly.GetExecutingAssembly();
string [] resources = thisExe.GetManifestResourceNames();
string list = "";

// Build the string of resources.
foreach (string resource in resources)
   list += resource + "\r\n";

Compiling the Code

Copy the code and paste it into the Main method of a console application.

See Also

Assembly Class | General Language Example Topics

Show:
© 2016 Microsoft