KeyFile的實現是這樣
/**
* KeyFile<br/>
* Date:
* Time:
*
* @author vhly[FR]
*/
public class KeyFile {
/*
<KeyType type=
<LicenseKey keyVersion=
<ExpireDate value=
<EMail value=
<MachinelInfo value=
<UserName value=
<ProductName value=
<ProductVersion value=
<ProductBuild value=
<ProductRegisterDate value=
<SerialNumber value=
<VerifyKey value=
<Evaluation value=
<Type value=
</LicenseKey>
</KeyType>
*/
private int keyType;
private String keyVersion;
private Date expiredDate;
private String email;
private String machinelInfo;
private String userName;
private String productName;
private String productVersion;
private String productBuild;
private Date registerDate;
private String serialNumber;
private String verifyKey;
private boolean evaluation;
private String upgradeSN;
private String tagValue;
private int type;
public String toXML(){
String ret = null;
StringBuffer ** = new StringBuffer();
**
**
**
**
**
**
**
**
**
**
**
**
**
**
**
**
**
ret = **
** = null;
return ret;
}
public KeyFile() {
keyType =
keyVersion =
Calendar cl = Calendar
cl
long d = cl
d /=
d *=
expiredDate = new Date(d);
email =
machinelInfo =
userName =
productName =
productVersion =
productBuild =
d = new Date()
d /=
d *=
registerDate = new Date(d);
serialNumber = Long
evaluation = false;
upgradeSN =
tagValue =
type =
}
public final String getVerifyKeyResult(){
String ret;
StringBuffer ** = new StringBuffer();
**
**
**
**
**
**
**
**
**
**
String s;
s = isEvaluation() ?
**
**
ret = **
** = null;
ret = eyj
return ret;
}
From:http://tw.wingwit.com/Article/program/Java/hx/201311/25762.html