LoginSignup
10
11

More than 5 years have passed since last update.

指定した変数名の変数を取得

Last updated at Posted at 2014-08-22

これも素晴らしいですね

・指定した変数名と一致する変数名の変数を取得

var fi = GetType().GetField(変数名, System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);

■下記参照
 http://msdn.microsoft.com/ja-jp/library/system.type.getfield(v=vs.110).aspx

■BindingFlagsに関しては下記参照
 http://msdn.microsoft.com/ja-jp/library/system.reflection.bindingflags(v=vs.110).aspx
 

10
11
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
11