Int32 _isProcessRunning;
_isProcessRunning = System.Diagnostics.Process.GetProcessesByName(
System.Diagnostics.Process.GetCurrentProcess().ProcessName).Length;
if(_isProcessRunning != 1)
{
MessageBox.Show("您的程序已经运行了,不能运行多个实例!","警告",MessageBoxButtons.OK,MessageBoxIcon.Warning);
}
else
{
try
{
PubForm.FlashForm fForm=new PubForm.FlashForm();//调用启动窗口
fForm.ShowDialog();
fForm.Dispose();
Application.Run(new MainForm());
}
catch(System.Exception ex)
{
System.Windows.Forms.MessageBox.Show(ex.Message.ToString());
Application.Exit();
}
}
}在刚启动主界面时,出现上面的错误提示,是何原因?