private void ILicenses_Click(object sender, RoutedEventArgs e) { if (InstallLicenses.IsBusy) { ToastMessage(Find("ToastWorkerIsBusy"), Find("MsgNormalTitle")); return; } if (CMessageBox.Show(Find("MsgInstallLicenses"), Find("MsgNormalTitle"), CMessageBoxButton.YesNO, CMessageBoxImage.Question) == CMessageBoxResult.Yes) { string Licenses_Dir; string Key; if (ConversionSelected.SelectedIndex == 0) { Licenses_Dir = TempInfo.FullName + "licenses\\VOL\\ProPlus16"; Key = "XQNVK-8JYDB-WJ9W3-YJ8YR-WFG99"; } else if (ConversionSelected.SelectedIndex == 1) { Licenses_Dir = TempInfo.FullName + "licenses\\VOL\\Mondo16"; Key = "HFTND-W9MK4-8B7MJ-B6C4G-XQBR2"; } else if (ConversionSelected.SelectedIndex == 2) { Licenses_Dir = TempInfo.FullName + "licenses\\VOL\\Project16"; Key = "WGT24-HCNMF-FQ7XH-6M8K7-DRTW9"; } else if (ConversionSelected.SelectedIndex == 3) { Licenses_Dir = TempInfo.FullName + "licenses\\VOL\\Visio16"; Key = "69WXN-MBYV6-22PQG-3WGHK-RM6XC"; } else if (ConversionSelected.SelectedIndex == 4) { Licenses_Dir = TempInfo.FullName + "licenses\\VOL\\ProPlus17"; Key = "NMMKJ-6RK4F-KMJVX-8D9MJ-6MWKP"; } else if (ConversionSelected.SelectedIndex == 5) { Licenses_Dir = TempInfo.FullName + "licenses\\VOL\\Project17"; Key = "B4NPR-3FKK7-T2MBV-FRQ4W-PKD2B"; } else if (ConversionSelected.SelectedIndex == 6) { Licenses_Dir = TempInfo.FullName + "licenses\\VOL\\Visio17"; Key = "9BGNQ-K37YR-RQHF2-38RQ3-7VCBB"; } else { string[] arg = new string[] { "2", "CommonLicenseFiles," + ConversionSelected.Text }; InstallLicenses.RunWorkerAsync(arg); return; } // 0 内置证书,1 证书路径,2 Office 文件夹 string[] ar = { "0", Licenses_Dir, Key, TempInfo.FullName + "licenses\\Common" }; InstallLicenses.RunWorkerAsync(ar); } }
private void InstallLicensesByPath_Click(object sender, RoutedEventArgs e) { if (InstallLicenses.IsBusy) { } else { System.Windows.Forms.FolderBrowserDialog m_Dialog = new System.Windows.Forms.FolderBrowserDialog { Description = Find("MsgSelectLicensesPath") }; System.Windows.Forms.DialogResult result = m_Dialog.ShowDialog(); if (result == System.Windows.Forms.DialogResult.OK) { string[] ar = new string[] { "1", m_Dialog.SelectedPath.Trim() }; InstallLicenses.RunWorkerAsync(ar); } } }