private void Form1_Load(object sender, EventArgs e) { listView1.Columns.Add("ID", 45); listView1.Columns.Add("ФИО", 280); listView1.Columns.Add("Дата рождения", 200); openFileDialog1.FileName = FileName; openFileDialog1.Filter = "(*.det)|*.det|All files (*.*)|*.*"; openFileDialog1.InitialDirectory = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); saveFileDialog1.FileName = openFileDialog1.FileName; saveFileDialog1.Filter = openFileDialog1.Filter; saveFileDialog1.InitialDirectory = openFileDialog1.InitialDirectory; button4.Enabled = false; button5.Enabled = false; license = new OpenLicense(Properties.Resources._public, Properties.Resources._public); OpenFileDialog licenseDialog = new OpenFileDialog(); licenseDialog.Filter = "Файл лицензии (*.xml)|*.xml"; panel1.Enabled = true; //if (licenseDialog.ShowDialog() == DialogResult.OK) //{ // panel1.Enabled = true;//license.TryLoadLicense(licenseDialog.FileName); //} }
private void label4_Click(object sender, EventArgs e) { if (openFileDialog1.ShowDialog() == DialogResult.OK) { string key = System.IO.File.ReadAllText(openFileDialog1.FileName); License = new OpenLicense(key); label4.Text = key; } }
private void button1_Click(object sender, EventArgs e) { License = new OpenLicense(); label4.Text = License.secretKey; }