Example #1
0
        public Lease GetLease()
        {
            Lease  lease        = null;
            string fullFileName = this.pathName + DongleGenerator.DONGLE;

            if (File.Exists(fullFileName))
            {
                FileStream   fs             = new FileStream(fullFileName, FileMode.Open, FileAccess.Read);
                BinaryReader binaryReader   = new BinaryReader(fs);
                byte[]       bytesEncrypted = binaryReader.ReadBytes(1000);
                binaryReader.Close();
                EnDec  enDec           = new EnDec();
                string stringDecrypted = enDec.Decrypt(bytesEncrypted);
                lease = new Lease(stringDecrypted);
            }
            return(lease);
        }