code_junkie

C# VS 2005: How to get a class's public member list during the runtime?

Nov 12th, 2011
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. Class Test01
  2. {
  3. public string str01;
  4. public string str02;
  5. public int myint01;
  6. }
  7.  
  8. Test01 tt = new Test01();
  9. foreach(variable v in tt.PublicVariableList)
  10. {
  11. debug.print v.name;
  12. debug.print v.type;
  13. }
  14.  
  15. foreach (MemberInfo mi in tt.GetType().GetMembers()) ...
Add Comment
Please, Sign In to add comment