问题提出:  

string str = "spp";
string spp = "very good"; 

  如何输出str的值是“very good”?

 

精彩回答:

  public partial class Form1 : Form
    {
        string str = "spp";
        public string spp = "very good";

        public Form1()
        {
            InitializeComponent();

            MessageBox.Show(this.GetType().GetField(str).GetValue(this).ToString());
        }
    }

 

原帖链接在此。

 

相关文章: