0

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!

xiagao1982
  • 1,077
  • 1
  • 13
  • 25
  • You need to learn what is reflection and how to use it. And the use it for this problem and come back here if you face any issue in that. – Chetan Dec 15 '18 at 07:15
  • Why not a duplicate of [Is there a way to set properties on struct instances using reflection?](https://stackoverflow.com/q/6280506)? – dbc Dec 15 '18 at 07:18

0 Answers0