/// <summary> /// 產生序號 /// </summary> /// <param name="ExpireDay">期限</param> /// <param name="MachineCode">PC的機械碼,5位數</param> /// <returns></returns> public string GenKey(int ExpireDay, int MachineCode = 0) { KeyGenerate GenKey = new KeyGenerate(); GenKey.secretPhase = KeyPhase.Phase + KeyGold.Gold; if (MachineCode == 0) { return(GenKey.doKey(ExpireDay, DateTime.Now, GenKey.MachineCode)); } else { return(GenKey.doKey(ExpireDay, DateTime.Now, MachineCode)); } }
/// <summary> /// 產生序號 /// </summary> /// <param name="ExpireDay"></param> /// <returns></returns> internal string GenKey(int ExpireDay) { //初始化方式不可按照visual studio建議的減化方式,否則建立出來的序號機械碼解碼出來後不會正確;// KeyGenerate GenKey = new KeyGenerate(); GenKey.secretPhase = KeyPhase.Phase + KeyGold.Gold; return(GenKey.doKey(ExpireDay, DateTime.Now, GenKey.MachineCode)); }