How to add item to existing List(Of String) using dnlib?

146 Views Asked by At

As stated in the question, how to add an item(of String type) to a List(Of String) using dnlib?

So far, this is my progress:

Private A As AssemblyDef = AssemblyDef.Load(Filename)
Public Sub AddtoList(ByVal Listname As String, ByVal Item As String)
        For Each ModuleDefintion As ModuleDef In A.Modules
            For Each TypeDefinition As TypeDef In ModuleDefintion.Types
                If TypeDefinition.Name = TypeName Then
                    For Each Field As FieldDef In TypeDefinition.Fields
                        If Field.Name.Equals(Listname) Then
                            ''Add Item to List here
                            ''What is the approach here?
                        End If
                    Next
                End If
            Next
        Next
    End Sub
0

There are 0 best solutions below