www.pudn.com > CS_ActiveRFID-DEMO_20140107A.rar > Setting.cs, change:2014-01-07,size:1542b


using System; 
using System.Collections.Generic; 
using System.ComponentModel; 
using System.Data; 
using System.Drawing; 
using System.Text; 
using System.Windows.Forms; 
using System.IO; 
using System.Threading; 
 
/* 
 *  
 * This project is for active RFID demo test; 
 * Created by Bill.Zhang 
 * Copyright reserved 2014; 
 *  
 */ 
 
 
 
namespace CS_ActiveRFID_DEMO 
{ 
    public partial class Setting : Form 
    { 
        ActiveRFID ActiveRFIDvar; 
        public Setting(ActiveRFID ActiveRFIDtemp) 
        { 
            InitializeComponent(); 
            ActiveRFIDvar = ActiveRFIDtemp; 
        } 
 
        private void buttonset_Click(object sender, EventArgs e) 
        { 
            if ((this.comboBox1.Text.Length > 0) && (this.comboBox2.Text.Length > 0)) 
            { 
                ActiveRFIDvar.serialPort1.Parity=System.IO.Ports.Parity.None; 
                ActiveRFIDvar.serialPort1.StopBits = System.IO.Ports.StopBits.One; 
                ActiveRFIDvar.serialPort1.DataBits=8; 
                ActiveRFIDvar.serialPort1.BaudRate = int.Parse(this.comboBox2.Text); 
                ActiveRFIDvar.serialPort1.PortName = this.comboBox1.Text; 
                ActiveRFIDvar.toolStripStatusLabel1.Text = "ComPort:" + this.comboBox1.Text; 
                ActiveRFIDvar.toolStripStatusLabel2.Text = "Baudrate:" + this.comboBox2.Text; 
                this.Close(); 
            } 
            else 
            { 
                MessageBox.Show("Please select the parameter!"); 
            } 
        } 
    } 
}