111,098
社区成员




private void button1_Click(object sender, EventArgs e)
{
Form frm = new Form();
frm.ShowDialog();
}
我这样写都没什么问题 会弹出一个什么也没有的窗体
static void Main()
{
#region Api_CallCreateMutex;
IntPtr hMutex;
string strAppName = System.Reflection.Assembly.GetExecutingAssembly().GetName().Name;
hMutex = CreateMutex(null, true, strAppName);
if (GetLastError() != ERROR_ALREADY_EXISTS)
{
Application.Run(new Form1()); ////////---->跳到这一句。
}
else
{
MessageBox.Show("本程序只允许同时运行一个");
ReleaseMutex(hMutex);
}
#endregion
}