RF_Wince1/RF_Client/Backup/rfidCaen/Program.cs

(完整代码) 1KB

using System;
using System.Collections.Generic;
using System.Windows.Forms;

namespace rfidCaen
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [MTAThread]
        static void Main()
        {
            const int ERROR_ALREADY_EXISTS = 0183;
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(OnUnhandledException);
            #region Api_Call CreateMutex;
            IntPtr hMutex;
            hMutex = Win32Api.CreateMutex(null, false, "RfidCaen");
            if (Win32Api.GetLastError() != ERROR_ALREADY_EXISTS)
            {
                Application.Run(new frmRFIdWriter());
            }
            else
            {
                Win32Api.ReleaseMutex(hMutex);
            }
            #endregion
        }
        private static void OnUnhandledException(Object sender, UnhandledExceptionEventArgs e)
        {
            Exception ex = e.ExceptionObject as Exception;
            if (ex != null)
            {
                MessageBox.Show("Ununknown Exception,the Application will withdraw!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
                Application.Exit();
                return;
            }
        }
    }
}

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。