示例#1
0
文件: Dog.cs 项目: dewade2003/DSJL
        /// <summary>
        /// 检查狗
        /// </summary>
        public static bool CheckDog(out string errorString)
        {
            bool checkResult = false;
            errorString = "";

            dog = new SuperDog.Dog(new DogFeature(100));
            DogStatus ds = dog.Login(vendorCode);
            switch (ds) {
                case DogStatus.StatusOk:
                    checkResult = true;
                    break;
                case DogStatus.LocalCommErr:
                    errorString = "请安装加密狗驱动!";
                    break;
                case DogStatus.TimeError:
                    errorString = "系统时钟已被篡改,请修改为当前时间!";
                    break;
                case DogStatus.DogNotFound:
                    errorString = "未找到所需的加密狗!";
                    break;
                case DogStatus.FeatureExpired:
                    errorString = "许可证已到期!";
                    break;
                case DogStatus.DeviceError:
                    errorString = "与超级狗通讯时出现USB 通信错误,请将加密狗插入其他USB接口重试!";
                    break;
            }
            dog.Logout();
            return checkResult;
        }
示例#2
0
文件: Dog.cs 项目: dewade2003/DSJL
        /// <summary>
        /// 检查狗
        /// </summary>
        public static bool CheckDog(out string errorString)
        {
            bool checkResult = false;

            errorString = "";

            dog = new SuperDog.Dog(new DogFeature(100));
            DogStatus ds = dog.Login(vendorCode);

            switch (ds)
            {
            case DogStatus.StatusOk:
                checkResult = true;
                break;

            case DogStatus.LocalCommErr:
                errorString = "请安装加密狗驱动!";
                break;

            case DogStatus.TimeError:
                errorString = "系统时钟已被篡改,请修改为当前时间!";
                break;

            case DogStatus.DogNotFound:
                errorString = "未找到所需的加密狗!";
                break;

            case DogStatus.FeatureExpired:
                errorString = "许可证已到期!";
                break;

            case DogStatus.DeviceError:
                errorString = "与超级狗通讯时出现USB 通信错误,请将加密狗插入其他USB接口重试!";
                break;
            }
            dog.Logout();
            return(checkResult);
        }