インスタンスからクラスメンバにアクセスする
Java と違って C# ではインスタンスからクラスメンバに直接アクセスすることができないみたいです。
以下のようにリフレクションを噛ますとアクセスできました。
using System; namespace TestCS01 { class Program { static void Main(string[] args) { Hoge h = new Hoge(); Console.WriteLine(h.A); // 普通のインスタンスメンバへのアクセス Console.WriteLine(Hoge.B); // 普通のクラスメンバへのアクセス // Console.WriteLine(h.B); // コンパイルエラー Console.WriteLine(h.GetType().GetProperty("B").GetValue(null,null)); } } class Hoge { private string a = "AAA"; public string A { get { return a; } } private static string b = "BBB"; public static string B { get { return b; } } } }