private void FlashFirmwareBetaToolStripMenuItem_Click(object sender, EventArgs e) { string[] paths = Directory.GetFiles(@"C:\adb\MIFlash", "XiaoMiFlash.exe"); string[] paths2 = Directory.GetFiles(@"C:\adb\MIFlash", "MiFlash20181115.zip"); if (paths.Length > 0) { try { var proc = new System.Diagnostics.Process(); proc = Process.Start(@"C:\adb\MIFlash\XiaoMiFlash.exe", ""); } catch { MessageBox.Show("XiaoMiFlash closed...", "Mi Flash", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } else { if (paths2.Length > 0) { Unzip.Unzippy(@"MIFlash\MiFlash20181115.zip", @"MIFlash", true); string[] zipfile = Directory.GetFiles(@"C:\adb\MIFlash\", "*.zip"); foreach (string f in zipfile) { File.Delete(f); } MessageBox.Show("Mi Flash extracted! Click again this option!", "Mi Flash", MessageBoxButtons.OK, MessageBoxIcon.Error); visual_reLoad(); } MessageBox.Show("Error on loading XiaoMiFlash, seems to be missing... You can download it on Download Mi Flash", "Mi Flash", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void unlockbootloader_Click(object sender, EventArgs e) { string[] paths = Directory.GetFiles(@"C:\adb\MIUnlock", "miflash_unlock.exe"); string[] paths2 = Directory.GetFiles(@"C:\adb\MIUnlock", "miflash_unlock-en-3.5.1128.45.zip"); if (paths.Length > 0) { try { var proc = new System.Diagnostics.Process(); proc = Process.Start(@"C:\adb\MIUnlock\miflash_unlock.exe", ""); } catch (Exception) { MessageBox.Show("Mi Unlock Closed...", "Mi Unlock", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } else { if (paths2.Length > 0) { Unzip.Unzippy(@"MIUnlock\miflash_unlock-en-3.5.1128.45.zip", @"MIUnlock", true); string[] zipfile = Directory.GetFiles(@"C:\adb\MIUnlock\", "*.zip"); foreach (string f in zipfile) { File.Delete(f); } MessageBox.Show("Mi Unlock extracted! Click again this option!", "Mi Unlock", MessageBoxButtons.OK, MessageBoxIcon.Error); visual_reLoad(); } MessageBox.Show("Error on loading Mi Unlock, seems to be missing... Please download it!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } if (System.IO.File.Exists(@"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe") & System.IO.File.Exists(@"C:\Program Files\Google\Chrome\Application\chrome.exe") == true) { BrowserCheck.StartBrowser("MicrosoftEdge.exe", "https://c.mi.com/thread-1857937-1-1.html"); } else { BrowserCheck.StartBrowser("Chrome.exe", "https://c.mi.com/thread-1857937-1-1.html"); } }