Hi,
I figured it out. Here it is. Please let me know if this is a correct
way. Also I still have to find out a way to get Linked resources. So
if you have any idea, please do tell me.
For Each modl As Mono.Cecil.ModuleDefinition In From Modules As
Mono.Cecil.ModuleDefinition _
In
defAssembly.Modules _
Select Modules
_
Order By
Modules.Name
For Each res As Mono.Cecil.EmbeddedResource In From Allres
As Mono.Cecil.EmbeddedResource _
In modl.Resources _
Select Allres _
Order By
Allres.Name
With ndResources
.ImageIndex = 36
.SelectedImageIndex = 36
With .Nodes.Add(res.Name, res.Name)
.Tag = res
.ImageIndex = 37
.SelectedImageIndex = 37
Dim mr As New MemoryStream(res.Data)
Dim resReader As New
Resources.ResourceReader(mr)
Dim dict As IDictionaryEnumerator =
resReader.GetEnumerator
While dict.MoveNext
.Nodes.Add(dict.Key, dict.Key & ": " &
dict.Value.ToString)
End While
End With
End With
Next
Next
TIA,
Kid.
On Oct 26, 11:41 am, Kid <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm using Mono.cecil v0.6 to read assemblies. I wanted to get all the
> embedded resources used by an assembly ( similar to the resources
> folder created by Reflector).
> I use the following code ( after reading some posts by JbEvain about
> manifest resources)
>
> For Each modl As Mono.Cecil.ModuleDefinition In <assembly
> definition>.Modules
> For Each res As Mono.Cecil.EmbeddedResource In
> modl.Resources
> < ???>
> Next
> Next
>
> I know that I can get the name of the resource file. But how will I
> know what it contains - all the resource string and all that.
>
> Any help would be much appreciated. TIA.
>
> Kid,
--~--~---------~--~----~------------~-------~--~----~
--
mono-cecil
-~----------~----~----~----~------~----~------~--~---