1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- using NumMachine;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using System.Windows.Navigation;
- using System.Windows.Shapes;
- using WpfApp1.Entry;
- namespace WpfApp1
- {
- /// <summary>
- /// MainWindow.xaml 的交互逻辑
- /// </summary>
- public partial class MainWindow : Window
- {
- public MainWindow()
- {
- InitializeComponent();
- IntPtr flpHandle = flowLayoutPanel1.Handle;
- SystemInitializer.Init(flpHandle);
- }
- private void win_Closed(object sender, EventArgs e)
- {
- SystemInitializer.Stop();
- Close();
- System.Environment.Exit(0);
- }
- private void GetNum_Click(object sender, RoutedEventArgs e)
- {
- if (SystemInitializer.numMachineLinker != null)
- {
- try
- {
- int id = Int32.Parse(NumMachineId.Text);
- string lic="";
- Task.Factory.StartNew(()=> {
- lic = SystemInitializer.numMachineLinker.GetLicensePlate(id);
- License.Dispatcher.BeginInvoke(new Action(() => { License.Text = lic; }));
-
- Console.WriteLine("号牌" + lic);
- });
- }
- catch { }
- }
- }
- }
- }
|