lundi 11 juillet 2016

How do I get the value of a sibling field in c#?

class A
{
    public B;
    public C;
}
C func()
{
    A a=new A();
    // set the fields in private
    return a.c;
}

I only have an object returned by func()

C c=func()

How do I get the value of the connected field b?

I know I can get the type of b through Type.ReflectedType,but I don't know how to get the value of b.





Aucun commentaire:

Enregistrer un commentaire