如下可以:
using System.Diagnostics;
//******************************************
Process[] localByName = Process.GetProcessesByName("TestProcess");
MessageBox.Show( localByName.Length.ToString() );
if ( localByName.Length >= 2 )
{
Application.Exit();
}
//******************************************