基本信息
源码名称:Win10系统,Office激活软件,获取本机信息
源码大小:72.59M
文件格式:.zip
开发语言:C#
更新时间:2021-03-29
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):78630559

本次赞助数额为: 5 元 
   源码介绍

Win10系统,Office激活软件,获取本机信息,查看本机的激活状态等等

static string ActivationName = "";    //产品名称
        static string ActivationState = "";    //产品激活状态
        static string ActiveVersions = "";    //激活版本
        /// <summary>
        /// 激活
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnActivation_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            try
            {
                Program.FrmPromptForm_lblTips_Text = "激活产品中,请稍等......";
                var Intselect = gridView.GetSelectedRows();
                if (Intselect.Length == 0) { MessageBox.Show("请选择需要激活的产品..."); return; }
                
                foreach (var selInt in Intselect)
                {
                    ActivationName = gridView.GetDataRow(selInt).ItemArray[0].ToString();
                    ActivationState = gridView.GetDataRow(selInt).ItemArray[1].ToString();
                    ActiveVersions = gridView.GetDataRow(selInt).ItemArray[3].ToString();

                    if (ActiveVersions == "")
                    {
                        MessageBox.Show(ActivationName "产品未选择激活版本,请选择所需版本后激活...");
                        return;
                    }
                    if (ActivationState == "已激活")
                    {
                        MessageBox.Show(ActivationName "该产品已激活过,无法再次激活......");
                        return;
                    }
                }
                
                Task SystemTask;   //操作系统线程
                Task OfficeTask;   //Office线程
                Task VisioTask;    //Visio线程
                Task ProjectTask;   //Project线程
                List<Task> TasksArray = new List<Task>();    //等待线程
                foreach (var selInt in Intselect)
                {
                    ActivationName = gridView.GetDataRow(selInt).ItemArray[0].ToString();
                    ActivationState = gridView.GetDataRow(selInt).ItemArray[1].ToString();
                    ActiveVersions = gridView.GetDataRow(selInt).ItemArray[3].ToString();
                    switch (ActivationName)
                    {
                        case "操作系统":
                            {
                                if (ActiveVersions == "Windows 10 企业版")
                                {
                                    SystemTask = Task.Run(() =>
                                    {
                                        CmdHelper.Command_ExecuteOutCmd($@"
slmgr -ipk W77WN-TP36G-VBJFX-C77HK-2YT44
slmgr -skms kms.03k.org
slmgr -ato
slmgr -dlv
");
                                    });
                                    TasksArray.Add(SystemTask);
                                    WriteJournal();
                                }
                                else if (ActiveVersions == "Windows 10 教育版")
                                {
                                    SystemTask = Task.Run(() =>
                                    {
                                        CmdHelper.Command_ExecuteOutCmd($@"
slmgr -ipk NW6C2-QMPVW-D7KKK-3GKT6-VCFB2
slmgr -skms kms8.MSGuides.com
slmgr -ato
slmgr -dlv
");
                                    });
                                    TasksArray.Add(SystemTask);
                                    WriteJournal();
                                }
                                else if (ActiveVersions == "Windows 10 专业版")
                                {
                                    SystemTask = Task.Run(() =>
                                    {
                                        CmdHelper.Command_ExecuteOutCmd($@"
slmgr -ipk W269N-WFGWX-YVC9B-4J6C9-T83GX
slmgr -skms kms8.MSGuides.com
slmgr -ato
slmgr -dlv
");
                                    });
                                    TasksArray.Add(SystemTask);
                                    WriteJournal();
                                }
                                break;
                            }
                        case "Office":
                            {
                                if (ActiveVersions == "Office 2019 ProPlus 专业版")
                                {
                                    OfficeTask = Task.Run(() =>
                                    {
                                        CmdHelper.Command_ExecuteOutCmd($@"
if exist ""%ProgramFiles%\Microsoft Office\Office16\ospp.vbs"" cd /d ""%ProgramFiles%\Microsoft Office\Office16""
if exist ""%ProgramFiles(x86)%\Microsoft Office\Office16\ospp.vbs"" cd /d ""%ProgramFiles(x86)%\Microsoft Office\Office16""
for /f %%x in ('dir /b ..\root\Licenses16\ProPlus2019VL*.xrm-ms') do cscript ospp.vbs /inslic:""..\root\Licenses16\%%x"" >nul
for /f %%x in ('dir /b ..\root\Licenses16\ProPlus2019VL*.xrm-ms') do cscript ospp.vbs /inslic:""..\root\Licenses16\%%x"" >nul
for /f %%x in ('dir /b ..\root\Licenses16\proplusvl_kms*.xrm-ms') do cscript ospp.vbs /inslic:""..\root\Licenses16\%%x"" >nul
for /f %%x in ('dir /b ..\root\Licenses16\proplusvl_mak*.xrm-ms') do cscript ospp.vbs /inslic:""..\root\Licenses16\%%x"" >nul
cscript //nologo ospp.vbs /unpkey:6MWKP >nul
cscript //nologo ospp.vbs /inpkey:NMMKJ-6RK4F-KMJVX-8D9MJ-6MWKP >nul
set i=1
:server
if %i%==1 set KMS_Sev=kms7.MSGuides.com
if %i%==2 set KMS_Sev=kms8.MSGuides.com
if %i%==3 set KMS_Sev=kms9.MSGuides.com
if %i%==4 goto notsupported
cscript //nologo ospp.vbs /sethst:%KMS_Sev% >nul
cscript //nologo ospp.vbs /act | find /i ""successful"" && (echo Complete) || (echo Trying another KMS Server & set /a i =1 & goto server)
");
                                    });
                                    TasksArray.Add(OfficeTask);
                                    WriteJournal();
                                }
                                break;
                            }
                        case "Visio":
                            {
                                if (ActiveVersions == "Visio 2019 Visio 专业版")
                                {
                                    VisioTask = Task.Run(() =>
                                    {
                                        CmdHelper.Command_ExecuteOutCmd($@"
if exist ""%ProgramFiles%\Microsoft Office\Office16\ospp.vbs"" cd /d ""%ProgramFiles%\Microsoft Office\Office16""
if exist ""%ProgramFiles(x86)%\Microsoft Office\Office16\ospp.vbs"" cd /d ""%ProgramFiles(x86)%\Microsoft Office\Office16""
cscript //nologo ospp.vbs /inslic:""..\root\Licenses16\pkeyconfig-office.xrm-ms"" >nul
for /f %%x in ('dir /b ..\root\Licenses16\client-issuance*.xrm-ms') do cscript ospp.vbs /inslic:""..\root\Licenses16\%%x"" >nul
for /f %%x in ('dir /b ..\root\Licenses16\visioprovl_kms*.xrm-ms') do cscript ospp.vbs /inslic:""..\root\Licenses16\%%x"" >nul
for /f %%x in ('dir /b ..\root\Licenses16\visiopro2019vl_kms*.xrm-ms') do cscript ospp.vbs /inslic:""..\root\Licenses16\%%x"" >nul
for /f %%x in ('dir /b ..\root\Licenses16\visio???vl_kms*.xrm-ms') do cscript ospp.vbs /inslic:""..\root\Licenses16\%%x"" >nul
for /f %%x in ('dir /b ..\root\Licenses16\visio???vl_mak*.xrm-ms') do cscript ospp.vbs /inslic:""..\root\Licenses16\%%x"" >nul
cscript //nologo ospp.vbs /unpkey:7VCBB >nul
cscript //nologo ospp.vbs /inpkey:9BGNQ-K37YR-RQHF2-38RQ3-7VCBB >nul
set i=1
:server
if %i%==1 set KMS_Sev=kms8.MSGuides.com
if %i%==2 set KMS_Sev=kms9.MSGuides.com
if %i%==3 set KMS_Sev=kms7.MSGuides.com
if %i%==4 goto notsupported
cscript //nologo ospp.vbs /sethst:%KMS_Sev% >nul
cscript //nologo ospp.vbs /act | find /i ""successful"" && (echo Complete) || (echo Trying another KMS Server & set /a i =1 & goto server)
");
                                    });
                                    TasksArray.Add(VisioTask);
                                    WriteJournal();
                                }
                                break;
                            }
                        case "Project":
                            {
                                if (ActiveVersions == "Visio 2019 Project 专业版")
                                {
                                    ProjectTask = Task.Run(() =>
                                    {
                                        CmdHelper.Command_ExecuteOutCmd($@"
if exist ""%ProgramFiles%\Microsoft Office\Office16\ospp.vbs"" cd /d ""%ProgramFiles%\Microsoft Office\Office16""
if exist ""%ProgramFiles(x86)%\Microsoft Office\Office16\ospp.vbs"" cd /d ""%ProgramFiles(x86)%\Microsoft Office\Office16""
cscript //nologo ospp.vbs /inslic:""..\root\Licenses16\pkeyconfig-office.xrm-ms"" >nul
for /f %%x in ('dir /b ..\root\Licenses16\client-issuance*.xrm-ms') do cscript ospp.vbs / inslic:""..\root\Licenses16\%%x"" >nul
for /f %%x in ('dir /b ..\root\Licenses16\projectprovl_kms*.xrm-ms') do cscript ospp.vbs / inslic:""..\root\Licenses16\%%x"" >nul
for /f %%x in ('dir /b ..\root\Licenses16\projectpro2019vl_kms*.xrm-ms') do cscript ospp.vbs / inslic:""..\root\Licenses16\%%x"" >nul
for /f %%x in ('dir /b ..\root\Licenses16\project???vl_kms*.xrm-ms') do cscript ospp.vbs / inslic:""..\root\Licenses16\%%x"" >nul
for /f %%x in ('dir /b ..\root\Licenses16\project???vl_mak*.xrm-ms') do cscript ospp.vbs / inslic:""..\root\Licenses16\%%x"" >nul
cscript //nologo ospp.vbs /unpkey:PKD2B >nul
cscript //nologo ospp.vbs /inpkey:B4NPR-3FKK7-T2MBV-FRQ4W-PKD2B >nul
set i=1
:server
if %i%==1 set KMS_Sev=kms9.MSGuides.com
if %i%==2 set KMS_Sev=kms8.MSGuides.com
if %i%==3 set KMS_Sev=kms7.MSGuides.com
if %i%==4 goto notsupported
cscript //nologo ospp.vbs /sethst:%KMS_Sev% >nul
cscript //nologo ospp.vbs /act | find /i ""successful"" && (echo Complete) || (echo Trying another KMS Server & set /a i =1 & goto server)
");
                                    });
                                    TasksArray.Add(ProjectTask);
                                    WriteJournal();
                                }
                                break;
                            }
                    }
                }
                Thread thread = new Thread(PromptForm);    //提示窗体
                thread.Start();

                Task[] TasksResult = TasksArray.ToArray();     //数组转换
                Task.WaitAll(TasksResult);    //等待线程完成

                CheckActivation.Check();      //重新获取激活状态
                System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer() { Interval = 1000, Enabled = true };
                timer.Tick = (a, b) =>
                {
                    if (CheckActivation.OfficeSuccessful == true && CheckActivation.ProjectSuccessful == true && CheckActivation.VisioSuccessful == true && CheckActivation.SystemSuccessful == true)
                    {
                        thread.Abort();
                        AddGrid();
                        timer.Stop();
                    }
                };
                timer.Start();
            }
            catch
            {
            }
        }