Exemple #1
0
 private void btn_load_ruleOfPort_Click(object sender, EventArgs e)
 {
     WriteReadHelper.setFilePath(filepath);
     try
     {
         WriteReadHelper.setWriteDataSet(ruleList);
         WriteReadHelper.WriteIntoFile();
         MessageBox.Show("导入成功!");
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Exemple #2
0
        private void FormOfPort_Load(object sender, EventArgs e)
        {
            ruleList = new List <string>();
            WriteReadHelper.setFilePath(filepath);
            try
            {
                WriteReadHelper.setReadDataSet(ruleList);
                WriteReadHelper.ReadFromFile();
                //MessageBox.Show("读取完成!");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            if (ruleList.Count != 0)
            {
                lstOfPortRule.DataSource = ruleList;
                //lstOfPortRule.DisplayMember = "Sign";
            }
            lstOfPortRule.SelectedIndex = -1;
        }