public static string CreateVerificationCode(EncryptionAndDecryption.UMPKeyAndIVType aKeyIVID) { string lStrReturn; int LIntRand; Random lRandom = new Random(); string LStrTemp; try { lStrReturn = DateTime.Now.ToString("yyyyMMddHHmmss"); LIntRand = lRandom.Next(0, 14); LStrTemp = LIntRand.ToString("00"); lStrReturn = lStrReturn.Insert(LIntRand, "VCT"); LIntRand = lRandom.Next(0, 17); LStrTemp += LIntRand.ToString("00"); lStrReturn = lStrReturn.Insert(LIntRand, "UMP"); LIntRand = lRandom.Next(0, 20); LStrTemp += LIntRand.ToString("00"); lStrReturn = lStrReturn.Insert(LIntRand, ((int)aKeyIVID).ToString("000")); lStrReturn = EncryptionAndDecryption.EncryptStringY(LStrTemp + lStrReturn); } catch { lStrReturn = string.Empty; } return(lStrReturn); }
private string CreateVerificationCodes(EncryptionAndDecryption.UMPKeyAndIVType keyIVID) { string strReturn; int LIntRand; Random random = new Random(); string strTemp; try { strReturn = DateTime.Now.ToString("yyyyMMddHHmmss"); LIntRand = random.Next(0, 14); strTemp = LIntRand.ToString("00"); strReturn = strReturn.Insert(LIntRand, "VCT"); LIntRand = random.Next(0, 17); strTemp += LIntRand.ToString("00"); strReturn = strReturn.Insert(LIntRand, "UMP"); LIntRand = random.Next(0, 20); strTemp += LIntRand.ToString("00"); strReturn = strReturn.Insert(LIntRand, ((int)keyIVID).ToString("000")); strReturn = EncryptionAndDecryption.EncryptStringY(strTemp + strReturn); } catch { strReturn = string.Empty; } return(strReturn); }