README.md
December 4, 2022 ยท View on GitHub
Description
If you want to drop a text file, an XML file, an icon, or a bitmap, or any other file, into your project directory and have it embedded with your solution, this will make it much easier to retrieve these resources. For instance, if you drop a file called "MainMenu.xml" into a project subdirectory called "Resources" (or, "[project directory]\Resources\MainMenu.xml") and you've marked it as an Embedded Resource, you can retrieve it programmatically like so: XmlDocument mainMenu = (XmlDocument)App.GetEmbeddedResource("Resources/MainMenu.xml");
More Info
| Submitted On | |
| By | Jon Davis |
| Level | Intermediate |
| User Rating | 4.8 (29 globes from 6 users) |
| Compatibility | C# |
| Category | Miscellaneous |
| World | .Net (C#, VB.net) |
| Archive File |
Source Code
// // This code is translated to VB.Net at // http://www.jondavis.net/files/misc/GetEmbeddedResource_VB.txt // using System; // TODO: Set the following line. namespace MyProjectNamespace { public class App { public static System.Reflection.Assembly Assembly { get { return ClassType.Assembly; } } public static Type ClassType { get { return typeof(App); } } ///