vendredi 14 décembre 2018

How to set a struct's field's field's value by reflection?

For example, I have the following code:

public struct Struct1
{
    public int F1;
}

public struct Struct2
{
    public Struct1 S1;
}

Struct2 s2 = new Struct2();

How can I set the value of s2.S1.F1 by reflection? Thanks!





Aucun commentaire:

Enregistrer un commentaire