예제 #1
0
        public int Compare(object x, object y)
        {
            MachineID mx = (MachineID)x;
            MachineID my = (MachineID)y;

            return(mx.Key.CompareTo(my.Key));
        }
예제 #2
0
        public bool VerifyAndAcceptLicense(Product product, ProductCodeName codeName, string publicKey, XmlDocument doc)
        {
            if (!VerifyLicense(publicKey, doc))
            {
                return(false);
            }

            PragmaLicense lic = FromXmlDocument(doc);
            MachineID     mId = MachineIdProvider.Retrieve(lic.MachineIdType);

            return((mId.Key.ToLowerInvariant() == lic.MachineKey.Key.ToLowerInvariant()) && (lic.ProductCodeName == codeName) &&
                   (lic.Product == product));
        }
예제 #3
0
        public static MachineID Retrieve(MachineIdType idType)
        {
            MachineID result = new MachineID();

            switch (idType)
            {
            case MachineIdType.Composite:
                result.Key = String.Format("{0}{1}", Retreive_ProcessorInfo(), Retreive_BaseBoardInfo());
                break;

            case MachineIdType.Composite2:
                result.Key = String.Format("{0}_{1}_{2}", Retreive_ProcessorInfo(), Retreive_BaseBoardInfo(), Retreive_BiosInfo());
                break;

            case MachineIdType.Simple:
            default:
                result.Key = Retreive_ProcessorInfo();
                break;
            }

            return(result);
        }
예제 #4
0
        public override bool Equals(object obj)
        {
            MachineID mObj = (MachineID)obj;

            return(this.Key == mObj.Key);
        }
예제 #5
0
        private void button2_Click(object sender, EventArgs e)
        {
            MachineID id = MachineIdProvider.Retrieve();

            txtMachineKey.Text = id.Key;
        }