日期:2014-05-17 浏览次数:20798 次
public class CTest
{
public int a = 1;
}
public static class CTestA
{
public static void show(this CTest test)
{
MessageBox.Show(test.a.ToString());
}
}
public partial class Form1 : Form
{
private void button1_Click(object sender, EventArgs e)
{
CTest t = new CTest();
t.show(); // <--竟然可以这么用!
}
}