Exemple #1
0
        //end public interface

        private void button1_Click(object sender, EventArgs e)
        {
            string devCode;
            string operationGroup;
            string region;
            int    foldId;
            string ret = "OK";

            try
            {
                devCode        = textBox1.Text.ToString();
                operationGroup = textBox2.Text.ToString();
                region         = textBox3.Text.ToString();
                foldId         = Convert.ToInt32(textBox4.Text.ToString());
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            try
            {
                deviceInfo devInfo = new deviceInfo();
                ret = devInfo.SetDeviceInfo(devCode, operationGroup, region, foldId);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }

            MessageBox.Show(ret);
        }
Exemple #2
0
        public Form1()
        {
            InitializeComponent();
            deviceInfo devInfo = new deviceInfo();

            try
            {
                devInfo.InitDeviceInfo();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            textBox1.Text = deviceInfo.deviceCode;
            textBox2.Text = deviceInfo.operationGroup;
            textBox3.Text = deviceInfo.region;
            textBox4.Text = Convert.ToString(deviceInfo.folderId);
        }