Exemplo n.º 1
0
        public frmTheaterInfoManage()
        {
            InitializeComponent();

            dataManager                  = new TheaterInfoManage();
            dataBindingSource            = new BindingSource();
            dataBindingSource.DataSource = dataManager.GetDataList();
        }
Exemplo n.º 2
0
        private void btnReader_Click(object sender, EventArgs e)
        {
            frmImport frm = new frmImport();

            if (frm.ShowDialog() == DialogResult.OK)
            {
                dataBindingSource.DataSource = dataManager.GetDataList();
                RefreshDataList();
            }
            //try
            //{
            //    string oldstr;
            //    string pathstr;
            //    OpenFileDialog file = new OpenFileDialog();
            //    file.Filter = "授权文件(*.key)|*.key|所有文件(*.*)|*.*";
            //    if (file.ShowDialog() == DialogResult.OK)
            //    {
            //        pathstr = file.FileName;

            //        StreamReader sr = new StreamReader(pathstr);
            //        oldstr = sr.ReadToEnd();
            //        string ss = RC6Encryption.Decrypt(oldstr);
            //        sr.Dispose();
            //        sr.Close();

            //        StreamWriter sw = new StreamWriter(pathstr, false);
            //        sw.Write(ss);
            //        sw.Flush();
            //        sw.Dispose();
            //        sw.Close();

            //        DataSet ds = new DataSet();
            //        ds.ReadXml(pathstr);

            //        sw = new StreamWriter(pathstr, false);
            //        sw.Write(oldstr);
            //        sw.Flush();
            //        sw.Dispose();
            //        sw.Close();
            //        dataManager.SetInfo(ds);
            //        dataBindingSource.DataSource = dataManager.GetDataList();
            //        RefreshDataList();
            //        MessageBox.Show("导入授权文件成功!", "信息提示");
            //    }
            //}
            //catch (Exception ex) { MessageBox.Show("导入授权文件失败!\n" + ex.Message, "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Error); }
        }