private void btn_delete_Click(object sender, EventArgs e) { string armaPath = Arma.GetArmaOAPath(); Directory.Delete(armaPath + "\\@dayzmod", true); File.Delete(armaPath + "\\" + Main.keyFileName); Application.Restart(); }
public Tools(bool full = false) { InitializeComponent(); if (full) { btn_changekey.Enabled = true; btn_changekey.Visible = true; box_cdkey.ReadOnly = false; } try { string armaPath = Arma.GetArmaOAPath() + "\\Expansion\\beta\\arma2oa.exe"; byte[] armaOaKey = Arma.GetArmaOAKey(); string cdkey = RegistryToSerial(armaOaKey); string input = cdkey.Substring(0, 4) + "-" + cdkey.Substring(4, 5) + "-" + cdkey.Substring(9, 5) + "-" + cdkey.Substring(14, 5) + "-" + cdkey.Substring(19, 5); box_hexkey.Text = BitConverter.ToString(armaOaKey); box_cdkey.Text = input; box_guid.Text = getMd5Hash("BE" + getMd5Hash(input)); btn_startUpdate.Visible = false; txtbox_arma1.Text = Arma.GetArmaPath(); txtbox_arma2.Text = Arma.GetArmaOAPath(); } catch (Exception ex) { MessageBox.Show(ex.Message); } new Thread(() => { if (CheckBetaPatch()) { if (btn_startUpdate.InvokeRequired) { btn_startUpdate.BeginInvoke(new Action(() => { btn_startUpdate.Visible = true; })); } else { btn_startUpdate.Visible = true; } } }).Start(); }