变量 asynchExecutions 确实发生了变化,但它不会更改引用变量。
简单的问题,为什么这个构造函数中的这个 ref 参数没有改变传入的原始值?
public partial class ThreadForm : Form
{
int asynchExecutions1 = 1;
public ThreadForm(out int asynchExecutions)
{
asynchExecutions = this.asynchExecutions1;
InitializeComponent();
}
private void start_Button_Click(object sender, EventArgs e)
{
int.TryParse(asynchExecution_txtbx.Text, out asynchExecutions1);
this.Dispose();
}
}