/// <summary>倒计时,然后启动副本计时器</summary> private void Timer_counter_Tick(object sender, EventArgs e) { if (MyVariable.sleep_s < 0) { Label_sleep.Visible = false; Timer_start.Enabled = true; Timer_start.Start(); Timer_counter.Stop(); Timer_counter.Enabled = false; } else { int h = MyVariable.sleep_s / 3600; int m = (MyVariable.sleep_s - (h * 3600)) / 60; int s = MyVariable.sleep_s - h * 3600 - m * 60; Label_sleep.Text = "剩余时间: " + h.ToString() + "时" + m.ToString() + "分" + s.ToString() + "秒"; MyVariable.sleep_s--; } }
private void Button_启动_Click(object sender, EventArgs e) { if (Method.Check()) { Method.Log("序列号路径:" + MyVariable.path_serial + "\r\n" + "appleID路径:" + MyVariable.path_appleID + "\r\n" + "联系人路径:" + MyVariable.path_contact + "\r\n", true); //步骤1:先全部克隆 for (int i = 0; i < MyVariable.sum; i++) { //MessageBox.Show("sum" + MyVariable.sum); //解析文件 string[] split_serial = MyVariable.array_serial[i].Split(new char[] { ':' }); //处理ROM,加% string s = split_serial[1]; s = split_serial[1].Insert(2, "%"); s = s.Insert(5, "%"); s = s.Insert(8, "%"); s = s.Insert(11, "%"); s = s.Insert(14, "%"); MyVariable.ROM.Add("%" + s); MyVariable.MLB.Add(split_serial[2]); MyVariable.serialNumber.Add(split_serial[3]); MyVariable.appendVmx.Add("efi.nvram.var.ROM = " + MyVariable.ROM[i] + "\r\n" + "efi.nvram.var.ROM.reflectHost = \"FALSE\"" + "\r\n" + "efi.nvram.var.MLB = " + MyVariable.MLB[i] + "\r\n" + "efi.nvram.var.MLB.reflectHost = \"FALSE\"" + "\r\n" + "smbios.reflectHost = \"FALSE\"" + "\r\n" + "serialNumber = " + MyVariable.serialNumber[i] + "\r\n" + "serialNumber.reflectHost = \"FALSE\"" + "\r\n" + "board-id = Mac-CAD6701F7CEA0921" + "\r\n" + "board-id.reflectHost = \"FALSE\"" + "\r\n" + "hw.model = MacBookPro14,2" + "\r\n" + "hw.model.reflectHost = \"FALSE\""); //克隆 Method.Clone(MyVariable.appleID[i], "qqy", true); //修改副本VMX Method.UpdataVMX(MyVariable.appleID[i], MyVariable.appendVmx[i]); //更新统计栏 Label_cloneNum.Text = (i + 1).ToString() + "/" + MyVariable.sum.ToString(); } //步骤2:倒计时,然后启动 Timer_counter.Enabled = true; Timer_counter.Start(); //操作完成 //更新统计栏 Label_startNum.Text = "0"; } }