private void FailedSwipeButton_Click(object sender, System.EventArgs e) { MsrSimulator MSRSim = ServiceObjectReference.Target as MsrSimulator; if (MSRSim != null) { MSRSim.OnCardSwipeFailed(); } }
private void SwipeCardButton_Click(object sender, System.EventArgs e) { MsrSimulator MSRSim = ServiceObjectReference.Target as MsrSimulator; if (MSRSim != null) { if (radioButton1.Checked) { string Track1Data = "%" + FixedLength("B" + tb1.Text + "^" + tb7.Text + "/" + tb3.Text + " " + tb4.Text + "." + tb8.Text + "^" + tb2.Text + tb5.Text, 76, '0') + "?"; string Track2Data = ";" + FixedLength(tb1.Text + "=" + tb2.Text + tb5.Text, 37, '0') + "?"; MSRSim.OnCardSwipe(MSRSim.StringToByteArray(Track1Data), MSRSim.StringToByteArray(Track2Data), null, null, CardType.Iso); } else { string city = VariableLength(tb17.Text, 15, '^'); string name = VariableLength(tb15.Text + '$' + tb6.Text + '$' + tb14.Text, 35, '^'); string address = FixedLength(tb1.Text, 77 - (city.Length + name.Length), ' '); string Track1Data = "%" + FixedLength(tb13.Text, 2, ' ') + city + name + address + "?"; string licnum = tb10.Text; string licnum1 = licnum, licnum2 = "="; if (licnum.Length > 13) { licnum1 = licnum.Substring(0, 13); licnum2 = licnum.Substring(13); if (licnum2.Length > 5) { licnum2 = licnum2.Substring(0, 5); } } string Track2Data = ";636010" + licnum1 + "=" + FixedLength(tb4.Text, 4, ' ') + FixedLength(tb2.Text, 8, ' ') + licnum2 + "?"; string Track3Data = "%00" + FixedLength(tb11.Text, 11, ' ') + FixedLength(tb18.Text, 2, ' ') + FixedLength(tb12.Text, 10, ' ') + FixedLength(tb3.Text, 4, ' ') + FixedLength(tb7.Text, 1, '1') + FixedLength(tb9.Text, 3, ' ') + FixedLength(tb16.Text, 3, ' ') + FixedLength(tb8.Text, 3, ' ') + FixedLength(tb5.Text, 3, ' ') + "?"; MSRSim.OnCardSwipe(MSRSim.StringToByteArray(Track1Data), MSRSim.StringToByteArray(Track2Data), MSRSim.StringToByteArray(Track3Data), null, CardType.Aamva); } } }
public MsrSimulatorWindow(MsrSimulator serviceObject) : base(serviceObject) { Invoke(new MethodDelegate(InitializeComponent)); }