public static IcCardParameter TemporaryIcCardContent(byte[] by) { IcCardParameter parameter = new IcCardParameter(); if (by.Length < 30) { return(parameter); } parameter.IcNumber = Encoding.ASCII.GetString(by, 0, 8); string plate = Encoding.Default.GetString(by, 8, 10); parameter.Plate = CRegex.IsPlate(plate) ? plate : GetHexStr(@by, 8, 10); string time = Encoding.Default.GetString(by, 18, 12); parameter.Time = CRegex.IsTime(time) ? DateTime.ParseExact(time, "yyMMddHHmmss", System.Globalization.CultureInfo.InstalledUICulture).ToString() : GetHexStr(@by, 18, 12); return(parameter); }
public static string GetModuleUpdateContent(byte[] by) { string str = GetLicensePlate(by, 0, 10); return(CRegex.IsPlate(str) ? str : string.Empty); }