Resource Management (C# vs Java)
In C# using Visual Studio, managing resources is simplified.
Java
Java applications are typically bundled in a JAR file, along with an application's various resources, such as class files, sound files, and image files. You’ll most likely use JBuilder or Eclipse which manage JAR files in much the same way that Visual Studio manages solutions and projects.
C#
In C# projects, you can simply open your resources from Visual Studio's Solution Explorer.
You can also use the Image Editor and the Binary Editor to work with resource files in managed projects.
For more information about adding resources to managed projects, see:
You can read these resources in your application as external content or embedded resources. For example, the following lines of code use the classes in the System.Reflection namespace and classes such as Assembly to read an embedded resource file from your assembly. In this case, the file is assemblyname.file.ext
.
static void Main()
{
System.Reflection.Assembly asm =
System.Reflection.Assembly.GetExecutingAssembly();
System.Drawing.Bitmap tiles = new System.Drawing.Bitmap
(asm.GetManifestResourceStream("assemblyname.file.ext"));
}
For more information, see Reflection (C# Programming Guide)
.
For more information on application resources, see Managing Application Resources.
For information on how the general resource editor works, see Resource Editors.
For more information about editing .Resx formatted resource files, see Resources in Applications.
For more information about handling XML and Simplified API for XML (SAX2) see SAX2 Developer Guide and XML Developer Center.
See Also
Concepts
C# Programming Guide
Adding and Editing Resources (Visual C#)