摘要:全域變數的功能
public class Global
{
public static int iVars = 0;
public static string Name="Tom";
}
public class MyForm : Form
{
private void Button_Click(object sender, EventArgs e)
{
MessageBox.Show(Global.iVars.ToString()+","+Global.Name.ToString());
}
}
解答:
0,Tom