变量和字符串的转换,其实用的是C#的反射功能,这其实和Java里面是一样。
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());
}
}