private void Form1_Load(object sender, EventArgs e)
{
GetLocalIP();
cmb_Type.SelectedIndex = 0;
Ping ping = new Ping();
if (ping.Send(Definitions.mServer).Status.ToString() != "Success")
{
MessageBox.Show("请检查网络");
return;
}
if (!SQLHelper.Test_IsvaildClientSoftVersion("TuningTest", Version.Substring(0, 3)))
{
MessageBox.Show("软件版本太旧,请更新", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
Application.Exit();
}
this.Text = "腔体提交V" + Version;
//连接矢网
frmwait.TopMost = true;
frmwait.Show();
Action acCon = new Action(ConVNA);
acCon.BeginInvoke(new AsyncCallback(MethodCompleted), acCon);
}
private void MethodCompleted(IAsyncResult asyncResult)
{
this.BeginInvoke(new Action(() =>
{
frmwait.Close();
if (isConVNA)
{
toolStripStatusLabel1.Text += " 连接矢网成功!";
}
else
{
toolStripStatusLabel1.Text += " " + errMsg;
}
}));
}
winform线程使用
最新推荐文章于 2024-04-29 10:13:57 发布