public Form1() { InitializeComponent(); string[] Port = SerialPort.GetPortNames(); for (int i = 0; i < Port.Count(); i++) { cbx_SerialList.Items.Add(Port[i]); } cbx_SerialList.SelectedIndex = 0; ArrayList date = FM1.ReadTxtToLst(System.Environment.CurrentDirectory + @"\1.FM1"); for (int i = 0; i < date.Count; i++) { string a = date[i].ToString(); listBox1.Items.Add(a); } }
private void btn_DeList_Click(object sender, EventArgs e) { listBox1.Items.RemoveAt(listBox1.Items.Count - 1); listBox1.Items.RemoveAt(listBox1.Items.Count - 1); FM1.WriteLstToTxt(listBox1, System.Environment.CurrentDirectory + @"\1.FM1"); }
private void btn_Conn_Click(object sender, EventArgs e) { listBox1.Items.Add("-->:" + txt_RetReceived.Text); listBox1.Items.Add("<--:" + txt_RetSend.Text); FM1.WriteLstToTxt(listBox1, System.Environment.CurrentDirectory + @"\1.FM1"); }