예제 #1
0
        /// <summary>
        /// 回调方法,检测配置文件
        /// </summary>
        /// <param name="stateInfo"></param>
        private static void CallbackTask(Object stateInfo)
        {
            #region   检测下文件是否存在
            if (CheckVersionConfig.CheckConfigFolderExit() == false)
            {
                MessageBox.Show("软件的匹配文件不存在,请联系厂家");
                Environment.Exit(0);
            }
            #endregion

            #region   检测是否存在试用期
            tryOut_enum tryOuy_ = CheckVersionConfig.CheckTryOut(IVer);
            switch (tryOuy_)
            {
            case tryOut_enum.noTryOut:

                break;

            case tryOut_enum.outOfDate:
                MessageBox.Show("软件的试用期过期,已经启动强制停止软件,请联系厂家");
                force_enum force_ = CheckVersionConfig.CheckForce(IVer);

                switch (force_)
                {
                case force_enum.expireForce:
                    Environment.Exit(0);
                    break;

                case force_enum.startForce:

                    break;

                case force_enum.stopForce:
                    break;
                }

                break;

            case tryOut_enum.tryOutDuring:

                break;

            default:

                break;
            }

            #endregion
        }
예제 #2
0
        /// <summary>
        /// 检测是否需要强制停止
        /// </summary>
        /// <param name="IVer_"></param>
        /// <returns></returns>
        internal force_enum CheckForce(IVersionConfig IVer_)
        {
            force_enum force_ = force_enum.stopForce;

            if (IVer_.ExitForceStop == true)
            {
                force_ = force_enum.startForce;

                DateTime dt1 = DateTime.Parse(IVer_.ForceStopDate_VersionConfig);

                if (DateTime.Now > dt1)
                {
                    force_ = force_enum.expireForce;
                }
            }

            return(force_);
        }