低频卡设计:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO.Ports;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
using System.Reflection.Emit;
namespace WindowsFormsApp1
{
public partial class Form1 : Form
{
SerialPort coml = new SerialPort(); //创建串口对象
Timer t = new Timer();
public Form1()
{
InitializeComponent();
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
}
private void Form1_Load(object sender, EventArgs e)
{
SerialPort com1 = new SerialPort();
String[] port = SerialPort.GetPortNames();
for (int i = 0; i < port.Length; i++)
{
comboBox1.Items.Add(port[i]);//添加串口号
}
t.Interval = 1000;
t.Stop();
t.Tick += new EventHandler(button2_Click);
if (!coml.IsOpen)
{
button1.Text = &#