first commit
This commit is contained in:
commit
0ebdf5287c
13
.idea/.idea.VoiletKmsTool/.idea/.gitignore
generated
vendored
Normal file
13
.idea/.idea.VoiletKmsTool/.idea/.gitignore
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# 默认忽略的文件
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
||||||
|
# Rider 忽略的文件
|
||||||
|
/projectSettingsUpdater.xml
|
||||||
|
/.idea.VoiletKmsTool.iml
|
||||||
|
/contentModel.xml
|
||||||
|
/modules.xml
|
||||||
|
# 基于编辑器的 HTTP 客户端请求
|
||||||
|
/httpRequests/
|
||||||
|
# Datasource local storage ignored files
|
||||||
|
/dataSources/
|
||||||
|
/dataSources.local.xml
|
4
.idea/.idea.VoiletKmsTool/.idea/encodings.xml
generated
Normal file
4
.idea/.idea.VoiletKmsTool/.idea/encodings.xml
generated
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
|
||||||
|
</project>
|
8
.idea/.idea.VoiletKmsTool/.idea/indexLayout.xml
generated
Normal file
8
.idea/.idea.VoiletKmsTool/.idea/indexLayout.xml
generated
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="UserContentModel">
|
||||||
|
<attachedFolders />
|
||||||
|
<explicitIncludes />
|
||||||
|
<explicitExcludes />
|
||||||
|
</component>
|
||||||
|
</project>
|
6
.idea/.idea.VoiletKmsTool/.idea/vcs.xml
generated
Normal file
6
.idea/.idea.VoiletKmsTool/.idea/vcs.xml
generated
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
16
VoiletKmsTool.sln
Normal file
16
VoiletKmsTool.sln
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VoiletKmsTool", "VoiletKmsTool\VoiletKmsTool.csproj", "{1F980D9E-50CE-411E-8A6A-5A11869DC19B}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{1F980D9E-50CE-411E-8A6A-5A11869DC19B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{1F980D9E-50CE-411E-8A6A-5A11869DC19B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{1F980D9E-50CE-411E-8A6A-5A11869DC19B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{1F980D9E-50CE-411E-8A6A-5A11869DC19B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
9
VoiletKmsTool/App.xaml
Normal file
9
VoiletKmsTool/App.xaml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<Application x:Class="VoiletKmsTool.App"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:local="clr-namespace:VoiletKmsTool"
|
||||||
|
StartupUri="MainWindow.xaml">
|
||||||
|
<Application.Resources>
|
||||||
|
|
||||||
|
</Application.Resources>
|
||||||
|
</Application>
|
17
VoiletKmsTool/App.xaml.cs
Normal file
17
VoiletKmsTool/App.xaml.cs
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Configuration;
|
||||||
|
using System.Data;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
|
||||||
|
namespace VoiletKmsTool
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaction logic for App.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class App : Application
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
10
VoiletKmsTool/AssemblyInfo.cs
Normal file
10
VoiletKmsTool/AssemblyInfo.cs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
using System.Windows;
|
||||||
|
|
||||||
|
[assembly: ThemeInfo(
|
||||||
|
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
|
||||||
|
//(used if a resource is not found in the page,
|
||||||
|
// or application resource dictionaries)
|
||||||
|
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
|
||||||
|
//(used if a resource is not found in the page,
|
||||||
|
// app, or any theme specific resource dictionaries)
|
||||||
|
)]
|
29
VoiletKmsTool/MainWindow.xaml
Normal file
29
VoiletKmsTool/MainWindow.xaml
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<Window x:Class="VoiletKmsTool.MainWindow"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
ResizeMode="NoResize"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
WindowStartupLocation="CenterScreen"
|
||||||
|
Title="VoiletKmsTool" Height="240" Width="315">
|
||||||
|
<StackPanel Margin="20" Orientation="Vertical">
|
||||||
|
|
||||||
|
<!-- 多语言选择 -->
|
||||||
|
<ComboBox SelectedIndex="0" Width="80" MaxDropDownHeight="260" x:Name="SystemLang" HorizontalAlignment="Left">
|
||||||
|
</ComboBox>
|
||||||
|
|
||||||
|
<!-- 系统版本 -->
|
||||||
|
<ComboBox SelectedIndex="0" Width="260" MaxDropDownHeight="260" x:Name="SystemVersion" Margin="0 10 " HorizontalAlignment="Left">
|
||||||
|
</ComboBox>
|
||||||
|
|
||||||
|
<!-- 激活服务器 -->
|
||||||
|
<Label Margin="0 0 " x:Name="ActionServer" HorizontalAlignment="Left">Action Server:</Label>
|
||||||
|
|
||||||
|
<!-- 激活服务器输入框 -->
|
||||||
|
<TextBox Width="150" HorizontalAlignment="Left" Name="ActionServerAddr" Margin="0 10 ">kms.03k.org</TextBox>
|
||||||
|
|
||||||
|
<!-- 激活按钮 -->
|
||||||
|
<Button Margin="0 10 " x:Name="SystemAction" Content="Action" Width="50" HorizontalAlignment="Left"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Window>
|
303
VoiletKmsTool/MainWindow.xaml.cs
Normal file
303
VoiletKmsTool/MainWindow.xaml.cs
Normal file
@ -0,0 +1,303 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
|
||||||
|
/* 存放系统版本信息和激活密钥的类 */
|
||||||
|
public class SystemList
|
||||||
|
{
|
||||||
|
public string SystemEnUsLang { get; set; } //英文翻译
|
||||||
|
public string SystemZhCNLang { get; set; } //中文翻译
|
||||||
|
public string SystemKeyValue { get; set; } //激活密钥
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace VoiletKmsTool
|
||||||
|
{
|
||||||
|
public partial class MainWindow : Window
|
||||||
|
{
|
||||||
|
bool ActionBtnLockStatus = true;
|
||||||
|
|
||||||
|
/* 没有崇洋媚外的意思,单纯因为系统版本用英文比较好记而且比较短 */
|
||||||
|
private int SystemLangStatus = 0;
|
||||||
|
|
||||||
|
//存放多语言选项
|
||||||
|
public string[] LangSupport = new string[2]
|
||||||
|
{
|
||||||
|
"English",
|
||||||
|
"简体中文"
|
||||||
|
};
|
||||||
|
|
||||||
|
//激活按钮
|
||||||
|
public string[] ActionButtonLang = new string[2]
|
||||||
|
{
|
||||||
|
"Action",
|
||||||
|
"激活"
|
||||||
|
};
|
||||||
|
|
||||||
|
//激活服务器
|
||||||
|
public string[] ActionServerLang = new string[2]
|
||||||
|
{
|
||||||
|
"Action Server",
|
||||||
|
"激活服务器"
|
||||||
|
};
|
||||||
|
|
||||||
|
//系统版本以及激活密钥
|
||||||
|
public List<SystemList> SystemList { get; set; } = new List<SystemList>()
|
||||||
|
{
|
||||||
|
new SystemList { SystemEnUsLang = "Windows 7 Pro", SystemZhCNLang = "Windows 7 专业版", SystemKeyValue = "FJ82H-XT6CR-J8D7P-XQJJ2-GPDD4" },
|
||||||
|
new SystemList { SystemEnUsLang = "Windows 7 Pro N", SystemZhCNLang = "Windows 7 专业版 N", SystemKeyValue = "MRPKT-YTG23-K7D7T-X2JMM-QY7MG" },
|
||||||
|
new SystemList { SystemEnUsLang = "Windows 7 Pro E", SystemZhCNLang = "Windows 7 专业版 E", SystemKeyValue = "W82YF-2Q76Y-63HXB-FGJG9-GF7QX" },
|
||||||
|
new SystemList { SystemEnUsLang = "Windows 7 Enterprise", SystemZhCNLang = "Windows 7 企业版", SystemKeyValue = "33PXH-7Y6KF-2VJC9-XBBR8-HVTHH" },
|
||||||
|
new SystemList { SystemEnUsLang = "Windows 7 Enterprise N", SystemZhCNLang = "Windows 7 企业版 N", SystemKeyValue = "YDRBP-3D83W-TY26F-D46B2-XCKRJ" },
|
||||||
|
new SystemList { SystemEnUsLang = "Windows 7 Enterprise E", SystemZhCNLang = "Windows 7 企业版 E", SystemKeyValue = "C29WB-22CC8-VJ326-GHFJW-H9DH4" },
|
||||||
|
new SystemList { SystemEnUsLang = "Windows 8 Pro", SystemZhCNLang = "Windows 8 专业版", SystemKeyValue = "NG4HW-VH26C-733KW-K6F98-J8CK4" },
|
||||||
|
new SystemList { SystemEnUsLang = "Windows 8 Pro N", SystemZhCNLang = "Windows 8 专业版 N", SystemKeyValue = "XCVCF-2NXM9-723PB-MHCB7-2RYQQ" },
|
||||||
|
new SystemList { SystemEnUsLang = "Windows 8 Enterprise", SystemZhCNLang = "Windows 8 企业版", SystemKeyValue = "32JNW-9KQ84-P47T8-D8GGY-CWCK7" },
|
||||||
|
new SystemList { SystemEnUsLang = "Windows 8 Enterprise N", SystemZhCNLang = "Windows 8 企业版 N", SystemKeyValue = "JMNMF-RHW7P-DMY6X-RF3DR-X2BQT" },
|
||||||
|
new SystemList { SystemEnUsLang = "Windows 8.1 Pro", SystemZhCNLang = "Windows 8.1 专业版", SystemKeyValue = "GCRJD-8NW9H-F2CDX-CCM8D-9D6T9" },
|
||||||
|
new SystemList { SystemEnUsLang = "Windows 8.1 Pro N", SystemZhCNLang = "Windows 8.1 专业版 N", SystemKeyValue = "HMCNV-VVBFX-7HMBH-CTY9B-B4FXY" },
|
||||||
|
new SystemList { SystemEnUsLang = "Windows 8.1 Enterprise", SystemZhCNLang = "Windows 8.1 企业版", SystemKeyValue = "MHF9N-XY6XB-WVXMC-BTDCT-MKKG7" },
|
||||||
|
new SystemList { SystemEnUsLang = "Windows 8.1 Enterprise N", SystemZhCNLang = "Windows 8.1 企业版 N", SystemKeyValue = "TT4HM-HN7YT-62K67-RGRQJ-JFFXW" },
|
||||||
|
new SystemList { SystemEnUsLang = "Windows 10/11 Home", SystemZhCNLang = "Windows 10/11 家庭版", SystemKeyValue = "TX9XD-98N7V-6WMQ6-BX7FG-H8Q99" },
|
||||||
|
new SystemList { SystemEnUsLang = "Windows 10/11 Home zh-cn", SystemZhCNLang = "Windows 10/11 家庭中文版", SystemKeyValue = "PVMJN-6DFY6-9CCP6-7BKTT-D3WVR" },
|
||||||
|
new SystemList { SystemEnUsLang = "Windows 10/11 Pro", SystemZhCNLang = "Windows 10/11 专业版", SystemKeyValue = "W269N-WFGWX-YVC9B-4J6C9-T83GX" },
|
||||||
|
new SystemList { SystemEnUsLang = "Windows 10/11 Pro N", SystemZhCNLang = "Windows 10/11 专业版 N", SystemKeyValue = "MH37W-N47XK-V7XM9-C7227-GCQG9" },
|
||||||
|
new SystemList { SystemEnUsLang = "Windows 10/11 Pro Workstation", SystemZhCNLang = "Windows 10/11 专业工作站版", SystemKeyValue = "NRG8B-VKK3Q-CXVCJ-9G2XF-6Q84J" },
|
||||||
|
new SystemList { SystemEnUsLang = "Windows 10/11 Pro Workstation N", SystemZhCNLang = "Windows 10/11 专业工作站版 N", SystemKeyValue = "9FNHH-K3HBT-3W4TD-6383H-6XYWF" },
|
||||||
|
new SystemList { SystemEnUsLang = "Windows 10/11 Pro Edu", SystemZhCNLang = "Windows 10/11 专业教育版", SystemKeyValue = "6TP4R-GNPTD-KYYHQ-7B7DP-J447Y" },
|
||||||
|
new SystemList { SystemEnUsLang = "Windows 10/11 Pro Edu N", SystemZhCNLang = "Windows 10/11 专业教育版 N", SystemKeyValue = "YVWGF-BXNMC-HTQYQ-CPQ99-66QFC" },
|
||||||
|
new SystemList { SystemEnUsLang = "Windows 10/11 Edu", SystemZhCNLang = "Windows 10/11 教育版", SystemKeyValue = "NW6C2-QMPVW-D7KKK-3GKT6-VCFB2" },
|
||||||
|
new SystemList { SystemEnUsLang = "Windows 10/11 Edu N", SystemZhCNLang = "Windows 10/11 教育版 N", SystemKeyValue = "2WH4N-8QGBV-H22JP-CT43Q-MDWWJ" },
|
||||||
|
new SystemList { SystemEnUsLang = "Windows 10/11 Enterprise", SystemZhCNLang = "Windows 10/11 企业版", SystemKeyValue = "NPPR9-FWDCX-D2C8J-H872K-2YT43" },
|
||||||
|
new SystemList { SystemEnUsLang = "Windows 10/11 Enterprise N", SystemZhCNLang = "Windows 10/11 企业版 N", SystemKeyValue = "DPH2V-TTNVB-4X9Q3-TJR4H-KHJW4" },
|
||||||
|
new SystemList { SystemEnUsLang = "Windows 10/11 Enterprise G", SystemZhCNLang = "Windows 10/11 企业版 G", SystemKeyValue = "YYVX9-NTFWV-6MDM3-9PT4T-4M68B" },
|
||||||
|
new SystemList { SystemEnUsLang = "Windows 10/11 Enterprise G N", SystemZhCNLang = "Windows 10/11 企业版 G N", SystemKeyValue = "44RPN-FTY23-9VTTB-MP9BX-T84FV" },
|
||||||
|
new SystemList { SystemEnUsLang = "Windows 10/11 LTSC", SystemZhCNLang = "Windows 10/11 长期支持版", SystemKeyValue = "M7XTQ-FN8P6-TTKYV-9D4CC-J462D" },
|
||||||
|
new SystemList { SystemEnUsLang = "Windows 10/11 LTSC N", SystemZhCNLang = "Windows 10/11 长期支持版 N", SystemKeyValue = "92NFX-8DJQP-P6BBQ-THF9C-7CG2H" },
|
||||||
|
new SystemList { SystemEnUsLang = "Windows 10/11 IoT LTSC", SystemZhCNLang = "Windows 10/11 物联网 长期支持版", SystemKeyValue = "KBN8V-HFGQ4-MGXVD-347P6-PDQGT" },
|
||||||
|
new SystemList { SystemEnUsLang = "Windows 10/11 LTSB 2016", SystemZhCNLang = "Windows 10/11 长期支持版 2016", SystemKeyValue = "DCPHK-NFMTC-H88MJ-PFHPY-QJ4BJ" },
|
||||||
|
new SystemList { SystemEnUsLang = "Windows 10/11 LTSB 2016 N", SystemZhCNLang = "Windows 10/11 长期支持版 2016 N", SystemKeyValue = "QFFDN-GRT3P-VKWWX-X7T3R-8B639" },
|
||||||
|
new SystemList { SystemEnUsLang = "Windows Server 2022 Standard", SystemZhCNLang = "Windows Server 2022 标准版", SystemKeyValue = "VDYBN-27WPP-V4HQT-9VMD4-VMK7H" },
|
||||||
|
new SystemList { SystemEnUsLang = "Windows Server 2022 Datacenter", SystemZhCNLang = "Windows Server 2022 数据中心版", SystemKeyValue = "WX4NM-KYWYW-QJJR4-XV3QB-6VM33" },
|
||||||
|
new SystemList { SystemEnUsLang = "Windows Server 2022 Datacenter Azure", SystemZhCNLang = "Windows Server 2022 数据中心版 Azure", SystemKeyValue = "NTBV8-9K7Q8-V27C6-M2BTV-KHMXV" },
|
||||||
|
new SystemList { SystemEnUsLang = "Windows Server 2019 Standard", SystemZhCNLang = "Windows Server 2019 标准版", SystemKeyValue = "N69G4-B89J2-4G8F4-WWYCC-J464C" },
|
||||||
|
new SystemList { SystemEnUsLang = "Windows Server 2019 Datacenter", SystemZhCNLang = "Windows Server 2019 数据中心版", SystemKeyValue = "WMDGN-G9PQG-XVVXX-R3X43-63DFG" },
|
||||||
|
new SystemList { SystemEnUsLang = "Windows Server 2019 Datacenter Azure", SystemZhCNLang = "Windows Server 2019 数据中心版 Azure", SystemKeyValue = "WVDHN-86M7X-466P6-VHXV7-YY726" },
|
||||||
|
new SystemList { SystemEnUsLang = "Windows Server 2016 Standard", SystemZhCNLang = "Windows Server 2016 标准版", SystemKeyValue = "WC2BQ-8NRM3-FDDYY-2BFGV-KHKQY" },
|
||||||
|
new SystemList { SystemEnUsLang = "Windows Server 2016 Datacenter", SystemZhCNLang = "Windows Server 2016 数据中心版", SystemKeyValue = "CB7KF-BWN84-R7R2Y-793K2-8XDDG" },
|
||||||
|
new SystemList { SystemEnUsLang = "Windows Server 2016 Datacenter Azure", SystemZhCNLang = "Windows Server 2016 数据中心版 Azure", SystemKeyValue = "JCKRF-N37P4-C2D82-9YXRT-4M63B" },
|
||||||
|
new SystemList { SystemEnUsLang = "Windows Server Standard Half Year", SystemZhCNLang = "Windows Server 标准版 半年", SystemKeyValue = "N2KJX-J94YW-TQVFB-DG9YT-724CC" },
|
||||||
|
new SystemList { SystemEnUsLang = "Windows Server Datacenter Half Year", SystemZhCNLang = "Windows Server 数据中心版 半年", SystemKeyValue = "6NMRW-2C8FM-D24W7-TQWMY-CWH2D" },
|
||||||
|
};
|
||||||
|
public MainWindow()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
|
||||||
|
//系统版本的下拉列表赋值,默认使用英语
|
||||||
|
ComboBox SystemVersionList = this.SystemVersion;
|
||||||
|
|
||||||
|
// 将系统版本信息添加到下拉列表中
|
||||||
|
foreach (var system in SystemList)
|
||||||
|
{
|
||||||
|
var newItem = new ComboBoxItem { Content = system.SystemEnUsLang };
|
||||||
|
SystemVersionList.Items.Add(newItem);
|
||||||
|
Console.WriteLine("Add List System Version = " + system.SystemEnUsLang + " KEY = " + system.SystemKeyValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
//设置下拉列表默认为0,不然会显示空值
|
||||||
|
SystemVersionList.SelectedIndex = 0;
|
||||||
|
|
||||||
|
//多语言选项添加
|
||||||
|
ComboBox SystemLangList = this.SystemLang;
|
||||||
|
|
||||||
|
//语言包列表
|
||||||
|
SystemLangList.ItemsSource = LangSupport;
|
||||||
|
|
||||||
|
//设置语言列表索引值为0,不然为空
|
||||||
|
SystemLangList.SelectedIndex = 0;
|
||||||
|
|
||||||
|
//绑定多语言选项的单击事件
|
||||||
|
this.SystemLang.SelectionChanged += SetLangHandler;
|
||||||
|
|
||||||
|
//绑定激活按钮点击事件
|
||||||
|
this.SystemAction.Click += SystemActionHandler;
|
||||||
|
}
|
||||||
|
|
||||||
|
//设置语言的点击函数
|
||||||
|
private void SetLangHandler(object? sender, SelectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
int LangIndex = this.SystemLang.SelectedIndex;
|
||||||
|
|
||||||
|
Console.WriteLine("Lang Index = " + LangIndex + " Support = " + LangSupport[LangIndex]);
|
||||||
|
|
||||||
|
TranslationApp(LangIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
//按钮点击事件函数
|
||||||
|
private void SystemActionHandler(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (ActionBtnLockStatus == false)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取系统版本下拉列表的索引
|
||||||
|
int SystemVersionIndex = this.SystemVersion.SelectedIndex;
|
||||||
|
|
||||||
|
//根据索引获取激活密钥
|
||||||
|
string SystemVersion = getSystemVersionInfo(SystemVersionIndex);
|
||||||
|
string SystemActionKey = getSystemActionKey(SystemVersionIndex);
|
||||||
|
string ActionServer = this.ActionServerAddr.Text;
|
||||||
|
|
||||||
|
if (ActionServer == null)
|
||||||
|
{
|
||||||
|
Console.WriteLine("ActionServer is empty,use kms.03k.org");
|
||||||
|
ActionServer = "kms.03k.org";
|
||||||
|
}
|
||||||
|
|
||||||
|
Console.WriteLine("System Version = " + SystemVersion);
|
||||||
|
Console.WriteLine("System Action Key = " + SystemActionKey);
|
||||||
|
Console.WriteLine("Action Server = " + ActionServer);
|
||||||
|
|
||||||
|
ActionBtnLockStatus = false;
|
||||||
|
//安装密钥
|
||||||
|
InstallActionKey(SystemActionKey);
|
||||||
|
|
||||||
|
//设置激活服务器
|
||||||
|
SetActionServer(ActionServer);
|
||||||
|
|
||||||
|
//开始激活
|
||||||
|
StartAction();
|
||||||
|
|
||||||
|
ActionBtnLockStatus = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
//翻译程序
|
||||||
|
private void TranslationApp(int index)
|
||||||
|
{
|
||||||
|
//修改激活服务文字
|
||||||
|
SetActionServerLang(index);
|
||||||
|
//修改激活按钮文字
|
||||||
|
SetActionButtnLang(index);
|
||||||
|
//修改系统版本文字
|
||||||
|
SetSystemVersionLang(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
//设置激活服务器语言翻译
|
||||||
|
private void SetActionServerLang(int ServerAddrLangIndex)
|
||||||
|
{
|
||||||
|
this.ActionServer.Content = ActionServerLang[ServerAddrLangIndex];
|
||||||
|
}
|
||||||
|
|
||||||
|
//设置激活按钮语言翻译
|
||||||
|
private void SetActionButtnLang(int ActionButtonLangIndex)
|
||||||
|
{
|
||||||
|
this.SystemAction.Content = ActionButtonLang[ActionButtonLangIndex];
|
||||||
|
}
|
||||||
|
|
||||||
|
//设置下拉列表中的系统版本翻译
|
||||||
|
private void SetSystemVersionLang(int SystemVersionLangIndex)
|
||||||
|
{
|
||||||
|
var SystemVersionListLang = this.SystemVersion;
|
||||||
|
|
||||||
|
//清空选项
|
||||||
|
SystemVersionListLang.Items.Clear();
|
||||||
|
|
||||||
|
switch (SystemVersionLangIndex)
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
//修改为中文
|
||||||
|
for (int i = 0; i < SystemList.Count; i++)
|
||||||
|
{
|
||||||
|
var newItem = new ComboBoxItem { Content = SystemList[i].SystemZhCNLang };
|
||||||
|
SystemVersionListLang.Items.Add(newItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
//修改为英文
|
||||||
|
for (int i = 0; i < SystemList.Count; i++)
|
||||||
|
{
|
||||||
|
var newItem = new ComboBoxItem { Content = SystemList[i].SystemEnUsLang };
|
||||||
|
SystemVersionListLang.Items.Add(newItem);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
//修改当前默认选中值
|
||||||
|
SystemVersionListLang.SelectedIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//根据下拉列表索引获取激活密钥
|
||||||
|
private string getSystemActionKey(int SelectIndex)
|
||||||
|
{
|
||||||
|
return SystemList[SelectIndex].SystemKeyValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
//根据下拉列表获取系统版本信息
|
||||||
|
private string getSystemVersionInfo(int SelectIndex)
|
||||||
|
{
|
||||||
|
return SystemList[SelectIndex].SystemEnUsLang;
|
||||||
|
}
|
||||||
|
|
||||||
|
//安装密钥
|
||||||
|
private void InstallActionKey(string ActionKey)
|
||||||
|
{
|
||||||
|
// 指令和参数
|
||||||
|
string Command = "slmgr";
|
||||||
|
string Arguments = "/ipk " + ActionKey; // 这是一个示例参数,你可以根据需要替换为其他参数
|
||||||
|
|
||||||
|
Console.WriteLine("Exec :" + Command + Arguments);
|
||||||
|
// 执行命令
|
||||||
|
ExecuteCommandAsAdmin(Command, Arguments);
|
||||||
|
}
|
||||||
|
|
||||||
|
//设置激活服务器
|
||||||
|
private void SetActionServer(string ActionServer)
|
||||||
|
{
|
||||||
|
// 指令和参数
|
||||||
|
string Command = "slmgr";
|
||||||
|
string Arguments = "/skms " + ActionServer; // 这是一个示例参数,你可以根据需要替换为其他参数
|
||||||
|
|
||||||
|
Console.WriteLine("Exec :" + Command + Arguments);
|
||||||
|
// 执行命令
|
||||||
|
ExecuteCommandAsAdmin(Command, Arguments);
|
||||||
|
}
|
||||||
|
|
||||||
|
//开始激活
|
||||||
|
private void StartAction()
|
||||||
|
{
|
||||||
|
// 指令和参数
|
||||||
|
string Command = "slmgr";
|
||||||
|
string Arguments = "/ato"; // 这是一个示例参数,你可以根据需要替换为其他参数
|
||||||
|
|
||||||
|
Console.WriteLine("Exec :" + Command + Arguments);
|
||||||
|
// 执行命令
|
||||||
|
ExecuteCommandAsAdmin(Command, Arguments);
|
||||||
|
}
|
||||||
|
|
||||||
|
//执行windows的slmgr命令
|
||||||
|
static void ExecuteCommandAsAdmin(string command, string arguments)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using (Process process = new Process())
|
||||||
|
{
|
||||||
|
process.StartInfo.FileName = "cmd.exe";
|
||||||
|
process.StartInfo.Arguments = $"/c {command} {arguments}";
|
||||||
|
process.StartInfo.UseShellExecute = true;
|
||||||
|
process.StartInfo.Verb = "runas"; // 管理员权限
|
||||||
|
process.Start();
|
||||||
|
|
||||||
|
// 等待进程结束
|
||||||
|
process.WaitForExit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Console.WriteLine("Run Try Catch: " + ex.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
10
VoiletKmsTool/VoiletKmsTool.csproj
Normal file
10
VoiletKmsTool/VoiletKmsTool.csproj
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>WinExe</OutputType>
|
||||||
|
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||||
|
<UseWPF>true</UseWPF>
|
||||||
|
<ApplicationIcon>images\windows.ico</ApplicationIcon>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
</Project>
|
@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"runtimeTarget": {
|
||||||
|
"name": ".NETCoreApp,Version=v3.1",
|
||||||
|
"signature": ""
|
||||||
|
},
|
||||||
|
"compilationOptions": {},
|
||||||
|
"targets": {
|
||||||
|
".NETCoreApp,Version=v3.1": {
|
||||||
|
"VoiletKmsTool/1.0.0": {
|
||||||
|
"runtime": {
|
||||||
|
"VoiletKmsTool.dll": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"libraries": {
|
||||||
|
"VoiletKmsTool/1.0.0": {
|
||||||
|
"type": "project",
|
||||||
|
"serviceable": false,
|
||||||
|
"sha512": ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
BIN
VoiletKmsTool/bin/Debug/netcoreapp3.1/VoiletKmsTool.dll
Normal file
BIN
VoiletKmsTool/bin/Debug/netcoreapp3.1/VoiletKmsTool.dll
Normal file
Binary file not shown.
BIN
VoiletKmsTool/bin/Debug/netcoreapp3.1/VoiletKmsTool.exe
Normal file
BIN
VoiletKmsTool/bin/Debug/netcoreapp3.1/VoiletKmsTool.exe
Normal file
Binary file not shown.
BIN
VoiletKmsTool/bin/Debug/netcoreapp3.1/VoiletKmsTool.pdb
Normal file
BIN
VoiletKmsTool/bin/Debug/netcoreapp3.1/VoiletKmsTool.pdb
Normal file
Binary file not shown.
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"runtimeOptions": {
|
||||||
|
"additionalProbingPaths": [
|
||||||
|
"C:\\Users\\anonymous\\.dotnet\\store\\|arch|\\|tfm|",
|
||||||
|
"C:\\Users\\anonymous\\.nuget\\packages"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"runtimeOptions": {
|
||||||
|
"tfm": "netcoreapp3.1",
|
||||||
|
"framework": {
|
||||||
|
"name": "Microsoft.WindowsDesktop.App",
|
||||||
|
"version": "3.1.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"runtimeTarget": {
|
||||||
|
"name": ".NETCoreApp,Version=v3.1",
|
||||||
|
"signature": ""
|
||||||
|
},
|
||||||
|
"compilationOptions": {},
|
||||||
|
"targets": {
|
||||||
|
".NETCoreApp,Version=v3.1": {
|
||||||
|
"VoiletKmsTool/1.0.0": {
|
||||||
|
"runtime": {
|
||||||
|
"VoiletKmsTool.dll": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"libraries": {
|
||||||
|
"VoiletKmsTool/1.0.0": {
|
||||||
|
"type": "project",
|
||||||
|
"serviceable": false,
|
||||||
|
"sha512": ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
BIN
VoiletKmsTool/bin/Release/netcoreapp3.1/VoiletKmsTool.dll
Normal file
BIN
VoiletKmsTool/bin/Release/netcoreapp3.1/VoiletKmsTool.dll
Normal file
Binary file not shown.
BIN
VoiletKmsTool/bin/Release/netcoreapp3.1/VoiletKmsTool.exe
Normal file
BIN
VoiletKmsTool/bin/Release/netcoreapp3.1/VoiletKmsTool.exe
Normal file
Binary file not shown.
BIN
VoiletKmsTool/bin/Release/netcoreapp3.1/VoiletKmsTool.pdb
Normal file
BIN
VoiletKmsTool/bin/Release/netcoreapp3.1/VoiletKmsTool.pdb
Normal file
Binary file not shown.
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"runtimeOptions": {
|
||||||
|
"additionalProbingPaths": [
|
||||||
|
"C:\\Users\\anonymous\\.dotnet\\store\\|arch|\\|tfm|",
|
||||||
|
"C:\\Users\\anonymous\\.nuget\\packages"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"runtimeOptions": {
|
||||||
|
"tfm": "netcoreapp3.1",
|
||||||
|
"framework": {
|
||||||
|
"name": "Microsoft.WindowsDesktop.App",
|
||||||
|
"version": "3.1.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
VoiletKmsTool/bin/Release/netcoreapp3.1/win-x64/PenImc_cor3.dll
Normal file
BIN
VoiletKmsTool/bin/Release/netcoreapp3.1/win-x64/PenImc_cor3.dll
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,5 @@
|
|||||||
|
SOS and other diagnostic tools now ship of band and work with any version of the .NET Core runtime.
|
||||||
|
|
||||||
|
SOS has moved to the diagnostics repo here: https://github.com/dotnet/diagnostics.git.
|
||||||
|
|
||||||
|
Instructions to install SOS: https://github.com/dotnet/diagnostics#installing-sos.
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
VoiletKmsTool/bin/Release/netcoreapp3.1/win-x64/System.Core.dll
Normal file
BIN
VoiletKmsTool/bin/Release/netcoreapp3.1/win-x64/System.Core.dll
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
VoiletKmsTool/bin/Release/netcoreapp3.1/win-x64/System.Data.dll
Normal file
BIN
VoiletKmsTool/bin/Release/netcoreapp3.1/win-x64/System.Data.dll
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user