指紋集成軟件開發
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO.Ports;//這個新的框架不但可以訪問計算機上的串口,還可以和串口設備進行通信。
using System.Timers;
namespace fingerprinttest
{
public partial class MainForm : Form
{
public MainForm()
{
InitializeComponent();
}
SerialPort sp = new SerialPort(); //聲明一個串口類
private void button1_Click(object sender, EventArgs e)
{
sp.Close();
sp = new SerialPort();
sp.PortName = comboBox1.Text;
sp.BaudRate = 57600;
sp.Open();//打開串口
}
private void button2_Click(object sender, EventArgs e)
{
sp.WriteLine(textBox1.Text);//往串口寫數據
}
}
}