Exemple #1
0
        private void DeleteKeySaveTODataCenterBaseEx(int KeyIDNumber)
        {
            //从数据库删除
            //ConnectionStringSettings CloudLockConnectString = ConfigurationManager.ConnectionStrings["CloudLockConnectString"];
            //LockKeyManager MyLockKeyManager = new LockKeyManager(CloudLockConnectString.ConnectionString);

            //LockKeyManager MyLockKeyManager = new LockKeyManager();

            LockKeyManager MyLockKeyManager = new LockKeyManager();

            LockKey AnyLockKey = new LockKey();

            AnyLockKey.LockID    = MyLockIDStr;
            AnyLockKey.LockKeyID = KeyIDNumber;

            //MyLockKeyManager.DeleteLockKeyEx(AnyLockKey);//--采用标志删除--

            MyLockKeyManager.DeleteLockKeyEx(AnyLockKey); //--采用标志删除--
        }
Exemple #2
0
        private void DeleteKeySynchProc()
        {
            string CreateDateStr;
            int    KeyCount;
            int    KeyID;

            //--密钥部分-------------------------------------------------------------------------------------------------------------
            KeyCount = this.MyReadBuffers[22];
            //MyAsynchLockServerSocketService.DisplayResultInfor(1, string.Format("当前有效密钥数[{0}]", KeyCount));
            //-----------------------------------------------------------------------------------------------------------------------
            LockKeyManager MyLockKeyManager = new LockKeyManager();

            for (int i = 0; i < KeyCount; i++)
            {
                int Index = 23 + 17 * i;
                KeyID         = this.MyReadBuffers[Index];
                CreateDateStr = null;
                CreateDateStr = Encoding.ASCII.GetString(this.MyReadBuffers, Index + 2, 15);
                //CreateDateStr = CreateDateStr.Insert(4, "-");
                //CreateDateStr = CreateDateStr.Insert(7, "-");
                //CreateDateStr = CreateDateStr.Insert(10, " ");
                //CreateDateStr = CreateDateStr.Insert(13, ":");
                //CreateDateStr = CreateDateStr.Insert(16, ":");
                //MyAsynchLockServerSocketService.DisplayResultInfor(1, string.Format("[{0}]号密钥创建日期[{1}]", KeyID, CreateDateStr));

                //LockKeyManager MyLockKeyManager = new LockKeyManager();

                LockKey AnyLockKey = new LockKey();
                AnyLockKey.LockID    = MyLockIDStr;
                AnyLockKey.LockKeyID = KeyID;

                //MyLockKeyManager.DeleteLockKeyEx(AnyLockKey);//--采用标志删除--
                MyLockKeyManager.DeleteLockKeyEx(AnyLockKey); //--采用标志删除--
                MyAsynchLockServerSocketService.DisplayResultInfor(1, string.Format("[{0}]删除[{1}]号密钥从数据库", MyLockIDStr, KeyID));
            }
        }