How to add images in embedded resource file at runtime?
Dim runTimeResourceSet As Object
Dim dictEntry As DictionaryEntry
runTimeResourceSet = My.Resources.ResourceManager.GetResourceSet(System.Globalization.CultureInfo.CurrentCulture, False, True)
For Each dictEntry In runTimeResourceSet
If (dictEntry.Value.GetType() Is GetType(Icon)) Then
Console.WriteLine(dictEntry.Key)
End If
Next
Here is the code to read the embedded resource files in windows form, Is there any 开发者_如何学Cway to add images to the resource files at runtime??
This Thread (right above yours) will lead you to that post, where you will find a hint to the ResourceWriter class.
This is possible, take a look at the CSharpCodeProvider class. Here is a tutorial on how it can be used to compile assemblies at runtime dynamically, it does now who how to add image resources but from what is there it is not hard to adapt the code to do what you ask.
Building .NET Assemblies at Runtime
精彩评论