public int Compare(object x, object y) { MachineID mx = (MachineID)x; MachineID my = (MachineID)y; return(mx.Key.CompareTo(my.Key)); }
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)); }
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); }
public override bool Equals(object obj) { MachineID mObj = (MachineID)obj; return(this.Key == mObj.Key); }
private void button2_Click(object sender, EventArgs e) { MachineID id = MachineIdProvider.Retrieve(); txtMachineKey.Text = id.Key; }