diff --git a/.vs/CMWTAT_DIGITAL/DesignTimeBuild/.dtbcache b/.vs/CMWTAT_DIGITAL/DesignTimeBuild/.dtbcache
deleted file mode 100644
index be35deb..0000000
Binary files a/.vs/CMWTAT_DIGITAL/DesignTimeBuild/.dtbcache and /dev/null differ
diff --git a/.vs/CMWTAT_DIGITAL/v15/.suo b/.vs/CMWTAT_DIGITAL/v15/.suo
deleted file mode 100644
index b67cdc6..0000000
Binary files a/.vs/CMWTAT_DIGITAL/v15/.suo and /dev/null differ
diff --git a/.vs/CMWTAT_DIGITAL/v15/Server/sqlite3/db.lock b/.vs/CMWTAT_DIGITAL/v15/Server/sqlite3/db.lock
deleted file mode 100644
index e69de29..0000000
diff --git a/.vs/CMWTAT_DIGITAL/v15/Server/sqlite3/storage.ide b/.vs/CMWTAT_DIGITAL/v15/Server/sqlite3/storage.ide
deleted file mode 100644
index 2ec5ff7..0000000
Binary files a/.vs/CMWTAT_DIGITAL/v15/Server/sqlite3/storage.ide and /dev/null differ
diff --git a/.vs/CMWTAT_DIGITAL/v15/Server/sqlite3/storage.ide-shm b/.vs/CMWTAT_DIGITAL/v15/Server/sqlite3/storage.ide-shm
deleted file mode 100644
index 383db34..0000000
Binary files a/.vs/CMWTAT_DIGITAL/v15/Server/sqlite3/storage.ide-shm and /dev/null differ
diff --git a/.vs/CMWTAT_DIGITAL/v15/Server/sqlite3/storage.ide-wal b/.vs/CMWTAT_DIGITAL/v15/Server/sqlite3/storage.ide-wal
deleted file mode 100644
index c87abf1..0000000
Binary files a/.vs/CMWTAT_DIGITAL/v15/Server/sqlite3/storage.ide-wal and /dev/null differ
diff --git a/.vs/config/applicationhost.config b/.vs/config/applicationhost.config
deleted file mode 100644
index 5441f24..0000000
--- a/.vs/config/applicationhost.config
+++ /dev/null
@@ -1,1022 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/CMWTAT_DIGITAL/App.xaml b/CMWTAT_DIGITAL/App.xaml
index 996f138..e7f7e0f 100644
--- a/CMWTAT_DIGITAL/App.xaml
+++ b/CMWTAT_DIGITAL/App.xaml
@@ -11,6 +11,7 @@
+
diff --git a/CMWTAT_DIGITAL/CMWTAT_DIGITAL.csproj b/CMWTAT_DIGITAL/CMWTAT_DIGITAL.csproj
index dc66538..7f9f825 100644
--- a/CMWTAT_DIGITAL/CMWTAT_DIGITAL.csproj
+++ b/CMWTAT_DIGITAL/CMWTAT_DIGITAL.csproj
@@ -9,7 +9,7 @@
WinExe
CMWTAT_DIGITAL
CMWTAT_DIGITAL
- v4.5
+ v4.5.2
512
{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
4
@@ -99,7 +99,11 @@
MSBuild:Compile
Designer
-
+
+ Designer
+ MSBuild:Compile
+
+
Designer
MSBuild:Compile
diff --git a/CMWTAT_DIGITAL/CMWTAT_DIGITAL.csproj.user b/CMWTAT_DIGITAL/CMWTAT_DIGITAL.csproj.user
index eb58e18..72a287b 100644
--- a/CMWTAT_DIGITAL/CMWTAT_DIGITAL.csproj.user
+++ b/CMWTAT_DIGITAL/CMWTAT_DIGITAL.csproj.user
@@ -1,7 +1,8 @@
- --hide -a
+
+
publish\
diff --git a/CMWTAT_DIGITAL/Lang/en.xaml b/CMWTAT_DIGITAL/Lang/en.xaml
new file mode 100644
index 0000000..ff3dd54
--- /dev/null
+++ b/CMWTAT_DIGITAL/Lang/en.xaml
@@ -0,0 +1,203 @@
+
+
+
+
+
+ Roboto
+
+
+
+
+
+ OK
+
+
+ Cancel
+
+
+ Refuse
+
+
+ Thanks developer and donate a dinner
+
+
+ Exit
+
+
+ Update Now
+
+
+ Ignore
+
+
+ CMWTAT Digital Edition
+
+
+ CMWTAT Digital Edition V2
+
+
+ A new version available!
+
+
+ Current Version
+
+
+ Latest Version
+
+
+ Auto Mode
+
+
+ Manual Mode
+
+
+ Activate
+
+
+ Convert versions (Install Key without Activate)
+
+
+ Test Text
+
+
+ Loading
+
+
+ Activating
+
+
+ Complete
+
+
+ CloudMoe Windows 10 Activation Toolkit V2
+
+
+ Running.
+
+
+ Experimental
+
+
+ Attention
+
+
+ System edition
+
+
+ Unable to correctly identify your operating system edition in support list, may be not be supported.
+
+
+ Only find experimental options that can be used with this operating system edition, little hope of activation success.
+
+
+ Your system edition may not be supported, program will exit. you can try add --expact or -e to startup.
+
+
+ Your system edition may not be supported, program will exit.
+
+
+ Unable to connect to server, Please check the network and try to try again later, program will exit.
+
+
+ Unable to connect to server, Please check the network and try to try again later, program will exit.
+
+
+ Converting
+
+
+ Activating
+
+
+ Getting Key via Internet
+
+
+ Getting Key via Internet
+
+
+ Uninstalling old Key
+
+
+ Uninstalling old Key
+
+
+ Uninstalling old Key (Experimental)
+
+
+ Installing Key
+
+
+ Installing Key
+
+
+ Getting edition code (Experimental)
+
+
+ Prepare for the next step (Experimental)
+
+
+ Writing feature of old Windows version
+
+
+ Getting free upgrade permissions
+
+
+ Cleaning changes
+
+
+ Getting digital license
+
+
+ Complete
+
+
+ Error
+
+
+ Code:
+
+
+ System return:
+
+
+
+
+
+This application now supports the use of console args to startup!
-a --auto Auto activate.
-h --hide Run with hide mode (Only be worked with -auto).
-e --expact Experimental activation.
-? --help Show this help Dialog.
+
+
+Congratulation!
Windows 10 has been successful converted.
+
+
+Congratulation!
Windows 10 has been successful activated.
+
+
+We found a new version for CloudMoe Windows 10 Activation Toolkit Digital Edition.
Please update to the latest version to make sure it works.
+
+
+We found a new version for CloudMoe Windows 10 Activation Toolkit Digital Edition.
And because your version is too old, so you MUST update to the latest version to make sure it works.
+
+
+Activate Windows 10 requires a network to gets the product key :)
+
+
+Cannot to uninstall old key. :(
+
+
+Cannot to install key, may be you choose or enter a incorrect version. :(
+
+
+Cannot to get edition code. :(
+
+
+Cannot to install key, may be you choose or enter a incorrect version. :(
+
+
+Time out, may be you choose or enter a incorrect version. :(
+
+
+Activation Failed. :(
Maybe:
1.This edition/version of Windows does not support digital license activation.
2. Unable to connect to Microsoft Windows Activation Server.
3. Other unexpected problems.
You can try to wait a minute or try again later.
+
+
\ No newline at end of file
diff --git a/CMWTAT_DIGITAL/Lang/zh.xaml b/CMWTAT_DIGITAL/Lang/zh.xaml
new file mode 100644
index 0000000..d585037
--- /dev/null
+++ b/CMWTAT_DIGITAL/Lang/zh.xaml
@@ -0,0 +1,203 @@
+
+
+
+
+
+ Microsoft YaHei UI
+
+
+
+
+
+ 好
+
+
+ 取消
+
+
+ 丑拒
+
+
+ 请顿晚饭,感谢作者
+
+
+ 退出
+
+
+ 立即更新
+
+
+ 忽略
+
+
+ 云萌 Windows 10 数字权利激活工具
+
+
+ CMWTAT Digital Edition V2
+
+
+ 新版本可用!
+
+
+ 当前版本
+
+
+ 最新版本
+
+
+ 自动模式
+
+
+ 手动模式
+
+
+ 激活
+
+
+ 版本无缝转换 (安装产品密钥而不激活)
+
+
+ 测试文本
+
+
+ 载入中
+
+
+ 激活中
+
+
+ 完成
+
+
+ 云萌 Windows 10 激活工具 V2
+
+
+ 运行中。
+
+
+ 实验性
+
+
+ 注意
+
+
+ 系统版本
+
+
+ 无法在支持列表里识别您的操作系统版本,可能不受支持。
+
+
+ 只找到用于此版本系统的实验性选项,成功概率极低。
+
+
+ 你的系统版本可能不受支持,程序即将退出。不过你可以尝试添加 --expact 或者 -e 参数来启动。
+
+
+ 你的系统版本可能不受支持,程序即将退出。
+
+
+ 无法连接服务器,请检查网络并尝试稍后重试,程序即将退出。
+
+
+ 无法连接服务器,请检查网络并尝试稍后重试,程序即将退出。
+
+
+ 转换中
+
+
+ 激活中
+
+
+ 正在通过网络获取产品密钥
+
+
+ 正在通过网络获取产品密钥
+
+
+ 正在卸载旧的产品密钥
+
+
+ 正在卸载旧的产品密钥
+
+
+ 正在卸载旧的产品密钥(实验性)
+
+
+ 正在安装产品密钥
+
+
+ 正在安装产品密钥
+
+
+ 正在获取版本代号(实验性)
+
+
+ 正在准备下一步(实验性)
+
+
+ 正在写入旧系统残留特征
+
+
+ 正在获取免费升级许可
+
+
+ 正在清理更改
+
+
+ 正在获取数字许可证
+
+
+ 完成
+
+
+ 错误
+
+
+ 代码:
+
+
+ 系统返回:
+
+
+
+
+
+这个应用现已支持通过控制台参数启动!
-a --auto 自动激活。
-h --hide 隐藏模式运行 (只能与 -auto 一起使用)。
-e --expact 实验性激活。
-? --help 显示此说明对话框。
+
+
+祝贺!
Windows 10 已经成功转换。
+
+
+祝贺!
Windows 10 已经成功激活。
+
+
+我们发现了新版本的 云萌 Windows10 数字权利激活工具。
请更新到最新版本来确保它可以正常工作。
+
+
+我们发现了新版本的 云萌 Windows10 数字权利激活工具。
由于您的版本太旧,所以您必须更新到最新版本来确保它可以正常工作。
+
+
+激活Windows10需要网络获取产品密钥 :)
+
+
+无法卸载旧密钥 :(
+
+
+无法安装密钥,可能没有选择或输入正确的版本 :(
+
+
+无法获取版本代号 :(
+
+
+无法安装密钥,可能没有选择或输入正确的版本 :(
+
+
+执行超时,可能没有选择正确或输入的版本 :(
+
+
+激活失败。 :(
可能因为:
1. 此版本/类型的 Windows 不支持数字权利(数字许可证)方式激活。
2. 无法连接到微软Windows激活服务器。
3. 其它未知问题。
你可以尝试稍等片刻或者稍后重试。
+
+
\ No newline at end of file
diff --git a/CMWTAT_DIGITAL/MainWindow.xaml b/CMWTAT_DIGITAL/MainWindow.xaml
index cfc7922..0805325 100644
--- a/CMWTAT_DIGITAL/MainWindow.xaml
+++ b/CMWTAT_DIGITAL/MainWindow.xaml
@@ -6,24 +6,25 @@
xmlns:domain="clr-namespace:CMWTAT_DIGITAL.Domain"
xmlns:local="clr-namespace:CMWTAT_DIGITAL"
mc:Ignorable="d"
- Title="CMWTAT Digital Edition V2" Height="550" Width="450"
+ Title="{DynamicResource TitleName}" Height="550" Width="450"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
TextElement.FontWeight="Regular"
TextElement.FontSize="13"
- TextOptions.TextFormattingMode="Ideal"
- TextOptions.TextRenderingMode="Auto"
+ TextOptions.TextFormattingMode="Ideal"
+ TextOptions.TextRenderingMode="Auto"
Background="{DynamicResource MaterialDesignPaper}"
- FontFamily="{DynamicResource MaterialDesignFont}"
ResizeMode="NoResize"
d:DataContext="{d:DesignInstance domain:ViewModel, d:IsDesignTimeCreatable=False}"
Icon="CMWTAT.ico"
Closing="Window_Closing"
+ FontFamily="{DynamicResource Font}"
>
+
-
+
@@ -39,15 +40,15 @@
-
+
-
-
+
+
-
-
+
+
@@ -57,7 +58,7 @@
- Loading
+
@@ -71,7 +72,7 @@
- Activating
+
@@ -85,13 +86,13 @@
- Loading
+
-
+ HorizontalAlignment="Center" Content="{DynamicResource Cancel}" />
@@ -105,14 +106,14 @@
- Title
- Hello World
+
+
-
+ HorizontalAlignment="Center" Content="{DynamicResource OK}" />
@@ -126,14 +127,14 @@
-
-
+
+
-
+ HorizontalAlignment="Center" Content="{DynamicResource OK}" />
@@ -147,13 +148,13 @@
- Error
- Unable to connect to server, program will exit.
+
+
-
+ HorizontalAlignment="Center" Content="{DynamicResource Exit}"/>
@@ -167,13 +168,13 @@
- Title
- Text
+ Title
+ Text
-
+ HorizontalAlignment="Center" Content="{DynamicResource OK}"/>
@@ -187,16 +188,35 @@
- Title
- Text
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/CMWTAT_DIGITAL/MainWindow.xaml.cs b/CMWTAT_DIGITAL/MainWindow.xaml.cs
index 05be703..ca314f5 100644
--- a/CMWTAT_DIGITAL/MainWindow.xaml.cs
+++ b/CMWTAT_DIGITAL/MainWindow.xaml.cs
@@ -22,9 +22,17 @@ using Microsoft.Win32;
using CMWTAT_DIGITAL.Domain;
using System.Text.RegularExpressions;
using System.Windows.Forms;
+using System.Globalization;
+using System.Reflection;
namespace CMWTAT_DIGITAL
{
+
+ static class Constants
+ {
+ public const string DefaultLang = "en"; // 缺省语言
+ }
+
///
/// MainWindow.xaml 的交互逻辑
///
@@ -112,6 +120,77 @@ namespace CMWTAT_DIGITAL
fileStream.Close();
}
+ public static string LocalLang = Constants.DefaultLang;
+ public static string NowLang = LocalLang;
+ ResourceDictionary langRd = null; //语言资源字典
+ public static CultureInfo currentCultureInfo = CultureInfo.CurrentCulture; //获取系统语言
+ public static bool NotSupportLang = false;
+
+ ///
+ /// 加载指定语言(支持热加载)
+ ///
+ public void LoadLang(string LangName = Constants.DefaultLang)
+ {
+
+ //MessageBox.Show(currentCultureInfo.Name);
+
+ try
+ {
+ //根据名字载入语言文件
+ langRd = System.Windows.Application.LoadComponent(new Uri(@"Lang\" + LangName + ".xaml", UriKind.Relative)) as ResourceDictionary;
+ NowLang = LangName;
+ if (LangName != Constants.DefaultLang)
+ {
+ LocalLang = LangName;
+ //btnChangeLang.Tag = LocalLang;
+ }
+ NotSupportLang = false;
+ }
+ catch
+ {
+ NotSupportLang = true;
+ //System.Windows.MessageBox.Show("The " + LangName + " language pack was not found and the language was set to English.\nIf you want to use Chinese as the interface language, click the \"Language\" button to switch.");
+ langRd = System.Windows.Application.LoadComponent(new Uri(@"Lang\" + Constants.DefaultLang + ".xaml", UriKind.Relative)) as ResourceDictionary;
+ NowLang = Constants.DefaultLang;
+ }
+
+ if (langRd != null)
+ {
+ //如果已使用其他语言,先清空
+ if (this.Resources.MergedDictionaries.Count > 0)
+ {
+ this.Resources.MergedDictionaries.Clear();
+ }
+ this.Resources.MergedDictionaries.Add(langRd);
+ }
+ }
+
+ string ProductVersion = "0.0.0.0"; // 存储程序版本
+
+ ///
+ /// 获取当前版本
+ ///
+ private void GetEdition()
+ {
+ Assembly assembly = Assembly.GetExecutingAssembly();
+
+ Console.WriteLine("AppAssemblyFullName: " + assembly.FullName);
+
+ // 获取程序集元数据
+ AssemblyCopyrightAttribute copyright = (AssemblyCopyrightAttribute)
+ AssemblyCopyrightAttribute.GetCustomAttribute(Assembly.GetExecutingAssembly(),
+ typeof(AssemblyCopyrightAttribute));
+ AssemblyDescriptionAttribute description = (AssemblyDescriptionAttribute)
+ AssemblyDescriptionAttribute.GetCustomAttribute(System.Reflection.Assembly.GetExecutingAssembly(),
+ typeof(AssemblyDescriptionAttribute));
+
+ ProductVersion = System.Windows.Forms.Application.ProductVersion;
+
+ Console.WriteLine("AppDescription: " + description.Description);
+ Console.WriteLine("AppCopyright: " + copyright.Copyright);
+ Console.WriteLine("AppProductVersion: " + System.Windows.Forms.Application.ProductVersion);
+ }
+
bool autoact = false;
bool hiderun = false;
bool expact = false;
@@ -125,6 +204,8 @@ namespace CMWTAT_DIGITAL
public MainWindow()
{
+ GetEdition(); // 获取程序版本
+
autoact = Program.autoact;
hiderun = Program.hiderun;
expact = Program.expact;
@@ -134,18 +215,28 @@ namespace CMWTAT_DIGITAL
InitializeComponent();
+ string LangName = currentCultureInfo.Name;
+ //根据本地语言来进行本地化
+ LangName = LangName.Substring(0, LangName.IndexOf("-"));
+ //LangName = "ja"; // 如需测试语言,请取消注释此行
+ LoadLang(LangName);
+
+ this.Title = this.Title + " V" + ProductVersion; // 初始化语言后为标题增加版本号
+
+ //System.Windows.MessageBox.Show((string)this.Resources["HelpText"]);
+
if (showhelp == true)
{
DialogHelp.IsOpen = true;
}
- notifyIcon = new System.Windows.Forms.NotifyIcon();
- notifyIcon.Text = "CloudMoe Windows 10 Activation Toolkit V2";
+ notifyIcon = new System.Windows.Forms.NotifyIcon(); // 先初始化托盘图标,以方便语言缺省时提示
+ notifyIcon.Text = (string)this.Resources["notifyIconTitle"]; //托盘图标标题
notifyIcon.Icon = ((System.Drawing.Icon)(CMWTAT_DIGITAL.Properties.Resources.CMWTAT_ICON));
- if (hiderun == true && autoact == true)
+ if ((hiderun == true && autoact == true) || NotSupportLang == true)
{
- this.Hide();
+
//notifyIcon.BalloonTipText = "The app has been minimised. Click the tray icon to show.";
//notifyIcon.BalloonTipTitle = "The App";
@@ -177,10 +268,24 @@ namespace CMWTAT_DIGITAL
//{
// if (e.Button == MouseButtons.Left) this.Show();
//});
+ }
+
+ if (NotSupportLang == true)
+ {
+ int tipShowMilliseconds = 0;
+ string tipTitle = (string)this.Resources["notifyIconTitle"];
+ string tipContent = "The language pack \"" + LangName + "\" was not found, language has been automatically switched to English. You can submit this language on GitHub."; // 提示不支持语言提示
+ ToolTipIcon tipType = ToolTipIcon.None;
+ notifyIcon.ShowBalloonTip(tipShowMilliseconds, tipTitle, tipContent, tipType);
+ }
+
+ if (hiderun == true && autoact == true)
+ {
+ this.Hide();
int tipShowMilliseconds = 0;
- string tipTitle = "CloudMoe Windows 10 Activation Toolkit V2";
- string tipContent = "Running.";
+ string tipTitle = (string)this.Resources["notifyIconTitle"]; //通知气泡标题
+ string tipContent = (string)this.Resources["Running"]; //提示正在运行
ToolTipIcon tipType = ToolTipIcon.None;
notifyIcon.ShowBalloonTip(tipShowMilliseconds, tipTitle, tipContent, tipType);
@@ -231,6 +336,55 @@ namespace CMWTAT_DIGITAL
LoadOSList();
}));
}
+
+ ///
+ /// 检查更新
+ ///
+ private void CheckUpdate()
+ {
+ try
+ {
+ string check_update_json = GetHttpWebRequest("https://cmwtat.cloudmoe.com/api/check_update?version=" + ProductVersion);
+ JObject check_update_jsonobj = JObject.Parse(check_update_json);
+ List check_update_list = new List();
+ JValue latest_version = (JValue)check_update_jsonobj["latest"];
+ JValue oldest_version = (JValue)check_update_jsonobj["oldest"];
+ //System.Windows.MessageBox.Show(latest_version.ToString());
+ Version CurrentVersion = new Version(ProductVersion);
+ Version LatestVersion = new Version(latest_version.ToString());
+ Version AllowedVersion = new Version(oldest_version.ToString());
+ if (CurrentVersion >= LatestVersion) // 当前版本大于等于最新版本
+ {
+ //System.Windows.MessageBox.Show("无需更新");
+ }
+ if (CurrentVersion < LatestVersion) // 当前版本小于最新版本
+ {
+ actbtn.Dispatcher.Invoke(new Action(() =>
+ {
+ if (CurrentVersion < AllowedVersion) // 当前版本小于最低允许版本
+ {
+ this.IgnoreUpdate.IsEnabled = false;
+ //System.Windows.MessageBox.Show("必须更新");
+ }
+ else
+ {
+ this.IgnoreUpdate.IsEnabled = true;
+ }
+ this.DialogUpdateTitle.Text = (string)this.Resources["UpdateTitle"];
+ this.DialogUpdateText.Text = (string)this.Resources["UpdateText"] + "\r\n" + (string)this.Resources["CurrentVersion"] + ": " + ProductVersion + "\r\n" + (string)this.Resources["LatestVersion"] + ": " + latest_version.ToString();
+ this.DialogUpdate.IsOpen = true;
+ }));
+ //System.Windows.MessageBox.Show("需要更新");
+ }
+ }
+ catch
+ {
+ }
+ }
+
+ public static string MainServerDomain = "https://cmwtat.cloudmoe.com"; // 主要服务器
+ public static string BackupServerDomain = "https://kms.kumo.moe"; // 备用服务器
+
private void LoadOSList()
{
@@ -240,9 +394,21 @@ namespace CMWTAT_DIGITAL
{
DialogWait.IsOpen = true;
}));
+
try
{
- string json = GetHttpWebRequest("https://kms.kumo.moe/api/digital?list=1&ver=2");
+ string json;
+ try
+ {
+ json = GetHttpWebRequest(MainServerDomain + "/api/digital?list=1&ver=2"); // 主要服务器
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine("MainServer:" + MainServerDomain + " is not working.");
+ Console.WriteLine("Error Message:" + e.Message);
+ Console.WriteLine("Ready to use BackupServer:" + BackupServerDomain);
+ json = GetHttpWebRequest(BackupServerDomain + "/api/digital?list=1&ver=2"); // 备用服务器
+ }
JObject jsonobj = JObject.Parse(json);
List list = new List();
Frequency freq = new Frequency();
@@ -284,15 +450,15 @@ namespace CMWTAT_DIGITAL
if (is_selected == 0)//没有匹配
{
this.SystemEditionText.SelectedIndex = 0;
- this.DialogWithOKToCloseDialogTitle.Text = "Attention";
- this.DialogWithOKToCloseDialogText.Text = "Unable to correctly identify your operating system edition, may be not be supported.\r\n(System edition: " + SystemEdition + OSVersionInfo.BuildVersion + ")";
+ this.DialogWithOKToCloseDialogTitle.Text = (string)this.Resources["Attention"];
+ this.DialogWithOKToCloseDialogText.Text = (string)this.Resources["May_be_not_be_supported"] + "\r\n(" + (string)this.Resources["System_Edition"] + ": " + SystemEdition + OSVersionInfo.BuildVersion + ")";
this.DialogWithOKToCloseDialog.IsOpen = true;
}
else if (is_selected == 2)//只找到实验性
{
this.SystemEditionText.SelectedIndex = 0;
- this.DialogWithOKToCloseDialogTitle.Text = "Attention";
- this.DialogWithOKToCloseDialogText.Text = "Only find experimental options that can be used with this operating system edition, little hope of activation success.\r\n(System edition: " + SystemEdition + OSVersionInfo.BuildVersion + ")";
+ this.DialogWithOKToCloseDialogTitle.Text = (string)this.Resources["Attention"];
+ this.DialogWithOKToCloseDialogText.Text = (string)this.Resources["Only_find_experimental"] + "\r\n(" + (string)this.Resources["System_Edition"] + ": " + SystemEdition + OSVersionInfo.BuildVersion + ")";
this.DialogWithOKToCloseDialog.IsOpen = true;
}
else
@@ -330,8 +496,8 @@ namespace CMWTAT_DIGITAL
if (hiderun == true)
{
int tipShowMilliseconds = 0;
- string tipTitle = "CloudMoe Windows 10 Activation Toolkit V2";
- string tipContent = "Your system edition may not be supported, program will exit. you can try add --expact or -e to startup.";
+ string tipTitle = (string)this.Resources["notifyIconTitle"];
+ string tipContent = (string)this.Resources["notify_May_be_not_be_supported_try"]; //提示不支持可尝试实验性
ToolTipIcon tipType = ToolTipIcon.None;
notifyIcon.ShowBalloonTip(tipShowMilliseconds, tipTitle, tipContent, tipType);
Exit_Button_Click(null, null);//退出
@@ -342,8 +508,8 @@ namespace CMWTAT_DIGITAL
if (hiderun == true)
{
int tipShowMilliseconds = 0;
- string tipTitle = "CloudMoe Windows 10 Activation Toolkit V2";
- string tipContent = "Your system edition may not be supported, program will exit.";
+ string tipTitle = (string)this.Resources["notifyIconTitle"];
+ string tipContent = (string)this.Resources["notify_May_be_not_be_supported_exit"]; //提示不支持并退出(实验性开启)
ToolTipIcon tipType = ToolTipIcon.None;
notifyIcon.ShowBalloonTip(tipShowMilliseconds, tipTitle, tipContent, tipType);
Exit_Button_Click(null, null);//退出
@@ -367,13 +533,14 @@ namespace CMWTAT_DIGITAL
if (hiderun == true && autoact == true)
{
int tipShowMilliseconds = 0;
- string tipTitle = "CloudMoe Windows 10 Activation Toolkit V2";
- string tipContent = "Unable to connect to server, program will exit.";
+ string tipTitle = (string)this.Resources["notifyIconTitle"];
+ string tipContent = (string)this.Resources["notify_Disconnect_to_server_exit"]; //提示无法连接服务器退出
ToolTipIcon tipType = ToolTipIcon.None;
notifyIcon.ShowBalloonTip(tipShowMilliseconds, tipTitle, tipContent, tipType);
Exit_Button_Click(null, null);//退出
}
}
+ CheckUpdate(); // 检查更新
}
private void Activate_Button_Click(object sender, RoutedEventArgs e)
{
@@ -394,22 +561,44 @@ namespace CMWTAT_DIGITAL
installthread.Start();
}
- private string GetHttpWebRequest(string url)
+ private string GetHttpWebRequest(string url, int timeout = 10000, int retry = 2)
{
- Uri uri = new Uri(url);
- HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create(uri);
- myReq.UserAgent = "User-Agent:Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705";
- myReq.Accept = "*/*";
- myReq.KeepAlive = true;
- myReq.Headers.Add("Accept-Language", "zh-cn,en-us;q=0.5");
- HttpWebResponse result = (HttpWebResponse)myReq.GetResponse();
- Stream receviceStream = result.GetResponseStream();
- StreamReader readerOfStream = new StreamReader(receviceStream, System.Text.Encoding.GetEncoding("utf-8"));
- string strHTML = readerOfStream.ReadToEnd();
- readerOfStream.Close();
- receviceStream.Close();
- result.Close();
- return strHTML;
+ string outex = "UnknowError";
+ for (int i = 0; i < retry; i++) // 默认重试2次
+ {
+ Console.WriteLine("GetHttpWebRequest Try: " + i.ToString());
+ try
+ {
+ Uri uri = new Uri(url);
+ HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create(uri);
+ myReq.UserAgent = "User-Agent:Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705";
+ myReq.Accept = "*/*";
+ myReq.KeepAlive = true;
+ myReq.Headers.Add("Accept-Language", "zh-cn,en-us;q=0.5");
+ myReq.Timeout = timeout; // 默认10s超时
+ HttpWebResponse result = null;
+ string strHTML = null;
+ result = (HttpWebResponse)myReq.GetResponse();
+ Stream receviceStream = result.GetResponseStream();
+ StreamReader readerOfStream = new StreamReader(receviceStream, System.Text.Encoding.GetEncoding("utf-8"));
+ strHTML = readerOfStream.ReadToEnd();
+ readerOfStream.Close();
+ receviceStream.Close();
+ result.Close();
+ return strHTML;
+ }
+ catch (WebException ex)
+ {
+ outex = ex.Message;
+ Console.WriteLine("GetHttpWebRequest Exception: " + ex.Message);
+ if (ex.Status == WebExceptionStatus.Timeout) // 超时重试
+ {
+ continue;
+ }
+ throw new Exception(ex.Message); // 其他错误抛出
+ }
+ }
+ throw new Exception(outex);
}
private void Exit_Button_Click(object sender, EventArgs e)
@@ -426,7 +615,7 @@ namespace CMWTAT_DIGITAL
actbtn.Dispatcher.Invoke(new Action(() =>
{
this.DialogActProg.IsOpen = true;
- this.activatingtext.Text = "Converting";
+ this.activatingtext.Text = (string)this.Resources["RunInstall_Converting"]; //提示转换中
}));
Wow64EnableWow64FsRedirection(false);//关闭文件重定向
@@ -455,14 +644,25 @@ namespace CMWTAT_DIGITAL
actbtn.Dispatcher.Invoke(new Action(() =>
{
- this.activatingtext.Text = "Getting Key";
+ this.activatingtext.Text = (string)this.Resources["RunInstall_Getting_Key"]; //提示正在获取密钥
}));
//获取密钥和SKU
try
{
- string json = GetHttpWebRequest("https://kms.kumo.moe/api/digital?list=0&ver=2");
+ string json;
+ try
+ {
+ json = GetHttpWebRequest(MainServerDomain + "/api/digital?list=0&ver=2"); // 主要服务器
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine("MainServer:" + MainServerDomain + " is not working.");
+ Console.WriteLine("Error Message:" + e.Message);
+ Console.WriteLine("Ready to use BackupServer:" + BackupServerDomain);
+ json = GetHttpWebRequest(BackupServerDomain + "/api/digital?list=0&ver=2"); // 备用服务器
+ }
JObject jsonobj = JObject.Parse(json);
List list = new List();
ositems = (JArray)jsonobj["OS"];
@@ -474,7 +674,7 @@ namespace CMWTAT_DIGITAL
catch
{
code = "-0";
- msg = "激活Windows10需要网络获取产品密钥 :) \nActivate Windows 10 requires a network to gets the product key :)";
+ msg = (string)this.Resources["ErrorMsg-0"]; // "激活Windows10需要网络获取产品密钥 :) \nActivate Windows 10 requires a network to gets the product key :)";
goto EndLine;
}
}
@@ -493,7 +693,7 @@ namespace CMWTAT_DIGITAL
actbtn.Dispatcher.Invoke(new Action(() =>
{
- this.activatingtext.Text = "Uninstalling old Key";
+ this.activatingtext.Text = (string)this.Resources["RunInstall_Uninstalling_old_Key"]; //提示正在卸载旧密钥
}));
//卸载
string runend = RunCScript(slmgr_self, "-upk").Trim();
@@ -503,7 +703,7 @@ namespace CMWTAT_DIGITAL
actbtn.Dispatcher.Invoke(new Action(() =>
{
- this.activatingtext.Text = "Installing Key";
+ this.activatingtext.Text = (string)this.Resources["RunInstall_Installing_Key"]; //提示正在安装密钥
}));
//安装数字权利升级密钥
@@ -514,25 +714,25 @@ namespace CMWTAT_DIGITAL
else
{
code = "-2";
- msg = "无法安装密钥,可能没有选择或输入正确的版本 :(\nCannot to install key, may be you choose or enter a incorrect version. :(";
+ msg = (string)this.Resources["ErrorMsg-2"]; // "无法安装密钥,可能没有选择或输入正确的版本 :(\nCannot to install key, may be you choose or enter a incorrect version. :(";
}
}
else
{
code = "-1";
- msg = "无法卸载旧密钥 :(\nCannot to uninstall old key. :(";
+ msg = (string)this.Resources["ErrorMsg-1"]; // "无法卸载旧密钥 :(\nCannot to uninstall old key. :(";
}
- //string runend = RunCScript(slmgr_self, "-upk").Trim();
- EndLine:;
+ //string runend = RunCScript(slmgr_self, "-upk").Trim();
+ EndLine:;
if (code != "200")
{
actbtn.Dispatcher.Invoke(new Action(() =>
{
this.DialogActProg.IsOpen = false;
- this.activatingtext.Text = "Converting";
+ this.activatingtext.Text = (string)this.Resources["RunInstall_Converting"]; //提示转换中
this.DialogWithOKToCloseDialog.IsOpen = true;
- this.DialogWithOKToCloseDialogTitle.Text = "Error";
- this.DialogWithOKToCloseDialogText.Text = msg + "\r\nCode:" + code;
+ this.DialogWithOKToCloseDialogTitle.Text = (string)this.Resources["ErrorTitle"]; //错误标题
+ this.DialogWithOKToCloseDialogText.Text = msg + "\r\n" + (string)this.Resources["ErrorCode"] + code; //错误代码 如:错误信息\r\nCode:000
}));
//MessageBox.Show(msg + "\r\nCode:" + code);
}
@@ -541,10 +741,10 @@ namespace CMWTAT_DIGITAL
actbtn.Dispatcher.Invoke(new Action(() =>
{
this.DialogActProg.IsOpen = false;
- this.activatingtext.Text = "Converting";
+ this.activatingtext.Text = (string)this.Resources["RunInstall_Converting"]; //提示转换中
this.DialogWithOKToCloseDialogDonate.IsOpen = true;
- this.DialogWithOKToCloseDialogDonateTitle.Text = "Complete";
- this.DialogWithOKToCloseDialogDonateText.Text = "\nCongratulation! \n\nWindows 10 has been successful converted.\n";
+ this.DialogWithOKToCloseDialogDonateTitle.Text = (string)this.Resources["CompleteTitle"]; //完成标题
+ this.DialogWithOKToCloseDialogDonateText.Text = (string)this.Resources["DonateTextConverted"]; //完成转换内容
}));
//MessageBox.Show("Congratulation!");
}
@@ -559,7 +759,7 @@ namespace CMWTAT_DIGITAL
if (hiderun == true && autoact == true)
{
int tipShowMilliseconds = 0;
- string tipTitle = "CloudMoe Windows 10 Activation Toolkit V2";
+ string tipTitle = (string)this.Resources["notifyIconTitle"];
string tipContent = this.activatingtext.Text;
ToolTipIcon tipType = ToolTipIcon.None;
notifyIcon.ShowBalloonTip(tipShowMilliseconds, tipTitle, tipContent, tipType);
@@ -574,7 +774,7 @@ namespace CMWTAT_DIGITAL
actbtn.Dispatcher.Invoke(new Action(() =>
{
this.DialogActProg.IsOpen = true;
- this.activatingtext.Text = "Activating";
+ this.activatingtext.Text = (string)this.Resources["RunAct_Activating"]; //提示激活中
ShowBallSameDig();
}));
@@ -606,7 +806,7 @@ namespace CMWTAT_DIGITAL
actbtn.Dispatcher.Invoke(new Action(() =>
{
- this.activatingtext.Text = "Getting Key";
+ this.activatingtext.Text = (string)this.Resources["RunAct_Getting_Key"]; //提示正在获取密钥
ShowBallSameDig();
}));
@@ -614,7 +814,18 @@ namespace CMWTAT_DIGITAL
try
{
- string json = GetHttpWebRequest("https://kms.kumo.moe/api/digital?list=0&ver=2");
+ string json;
+ try
+ {
+ json = GetHttpWebRequest(MainServerDomain + "/api/digital?list=0&ver=2"); // 主要服务器
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine("MainServer:" + MainServerDomain + " is not working.");
+ Console.WriteLine("Error Message:" + e.Message);
+ Console.WriteLine("Ready to use BackupServer:" + BackupServerDomain);
+ json = GetHttpWebRequest(BackupServerDomain + "/api/digital?list=0&ver=2"); // 备用服务器
+ }
JObject jsonobj = JObject.Parse(json);
List list = new List();
ositems = (JArray)jsonobj["OS"];
@@ -631,7 +842,7 @@ namespace CMWTAT_DIGITAL
catch
{
code = "-0";
- msg = "激活Windows10需要网络获取产品密钥 :) \nActivate Windows 10 requires a network to gets the product key :)";
+ msg = (string)this.Resources["ErrorMsg-0"]; // "激活Windows10需要网络获取产品密钥 :) \nActivate Windows 10 requires a network to gets the product key :)";
goto EndLine;
}
@@ -649,7 +860,7 @@ namespace CMWTAT_DIGITAL
actbtn.Dispatcher.Invoke(new Action(() =>
{
- this.activatingtext.Text = "Uninstalling old Key";
+ this.activatingtext.Text = (string)this.Resources["RunAct_Uninstalling_old_Key"]; //提示正在卸载旧密钥
ShowBallSameDig();
}));
@@ -666,7 +877,7 @@ namespace CMWTAT_DIGITAL
actbtn.Dispatcher.Invoke(new Action(() =>
{
- this.activatingtext.Text = "Getting edition code (Experimental)";
+ this.activatingtext.Text = (string)this.Resources["RunAct_Getting_edition_code_Exp"]; // "Getting edition code (Experimental)";
ShowBallSameDig();
}));
@@ -682,7 +893,7 @@ namespace CMWTAT_DIGITAL
{
actbtn.Dispatcher.Invoke(new Action(() =>
{
- this.activatingtext.Text = "Uninstalling old Key (Experimental)";
+ this.activatingtext.Text = (string)this.Resources["RunAct_Uninstalling_old_Key_Exp"]; //提示正在卸载旧密钥(实验性)
ShowBallSameDig();
}));
@@ -692,7 +903,7 @@ namespace CMWTAT_DIGITAL
{
actbtn.Dispatcher.Invoke(new Action(() =>
{
- this.activatingtext.Text = "Prepare for the next step (Experimental)";
+ this.activatingtext.Text = (string)this.Resources["RunAct_Prepare_for_the_next_step_Exp"]; // "Prepare for the next step (Experimental)";
ShowBallSameDig();
}));
}
@@ -700,14 +911,14 @@ namespace CMWTAT_DIGITAL
else
{
code = "-1.2";
- msg = "无法获取版本代号 :(\nCannot to get edition code. :(";
+ msg = (string)this.Resources["ErrorMsg-1.2"]; // "无法获取版本代号 :(\nCannot to get edition code. :(";
goto EndLine;
}
}
else
{
code = "-1.1";
- msg = "无法安装密钥,可能没有选择或输入正确的版本 :(\nCannot to install key, may be you choose or enter a incorrect version. :(";
+ msg = (string)this.Resources["ErrorMsg-1.1"]; // "无法安装密钥,可能没有选择或输入正确的版本 :(\nCannot to install key, may be you choose or enter a incorrect version. :(";
goto EndLine;
}
}
@@ -717,7 +928,7 @@ namespace CMWTAT_DIGITAL
actbtn.Dispatcher.Invoke(new Action(() =>
{
- this.activatingtext.Text = "Writing feature of old Windows version";
+ this.activatingtext.Text = (string)this.Resources["RunAct_Writing_old_OS"]; // "Writing feature of old Windows version";
ShowBallSameDig();
}));
@@ -728,7 +939,7 @@ namespace CMWTAT_DIGITAL
actbtn.Dispatcher.Invoke(new Action(() =>
{
- this.activatingtext.Text = "Installing Key";
+ this.activatingtext.Text = (string)this.Resources["RunAct_Installing_Key"]; //提示正在安装密钥
ShowBallSameDig();
}));
@@ -741,7 +952,7 @@ namespace CMWTAT_DIGITAL
actbtn.Dispatcher.Invoke(new Action(() =>
{
- this.activatingtext.Text = "Getting free upgrade permissions";
+ this.activatingtext.Text = (string)this.Resources["RunAct_Getting_free_upgrade_permissions"]; // "Getting free upgrade permissions";
ShowBallSameDig();
}));
@@ -760,7 +971,7 @@ namespace CMWTAT_DIGITAL
actbtn.Dispatcher.Invoke(new Action(() =>
{
- this.activatingtext.Text = "Cleaning changes";
+ this.activatingtext.Text = (string)this.Resources["RunAct_Cleaning_changes"]; // "Cleaning changes";
ShowBallSameDig();
}));
@@ -769,20 +980,21 @@ namespace CMWTAT_DIGITAL
actbtn.Dispatcher.Invoke(new Action(() =>
{
- this.activatingtext.Text = "Getting digital license";
+ this.activatingtext.Text = (string)this.Resources["RunAct_Getting_digital_license"]; // "Getting digital license";
ShowBallSameDig();
}));
- Wow64EnableWow64FsRedirection(false);//关闭文件重定向
+ Wow64EnableWow64FsRedirection(false); // 关闭文件重定向
RunCMD(Environment.SystemDirectory + @"\ClipUp.exe -v -o -altto " + tempfile);
actbtn.Dispatcher.Invoke(new Action(() =>
{
- this.activatingtext.Text = "Activating";
+ this.activatingtext.Text = (string)this.Resources["RunAct_Activating"]; // 提示激活中
ShowBallSameDig();
}));
runend = RunCScript(slmgr_self, "-ato").Trim();
+ Console.WriteLine(runend);
if (runend.EndsWith("060' to display the error text.") || runend.EndsWith("successfully.") || runend.EndsWith("to display the error text."))
{
code = "200";
@@ -790,41 +1002,41 @@ namespace CMWTAT_DIGITAL
else
{
code = "-4";
- msg = "激活失败 :(\nActivation Failed. :(";
+ msg = (string)this.Resources["ErrorMsg-4"] + "\r\n" + (string)this.Resources["SysMsg"] + "\r\n" + runend; // "激活失败 :(\nActivation Failed. :(";
}
}
else
{
code = "-3";
- msg = "执行超时,可能没有选择正确或输入的版本 :(\nTime out, may be you choose or enter a incorrect version. :(";
+ msg = (string)this.Resources["ErrorMsg-3"]; // "执行超时,可能没有选择正确或输入的版本 :(\nTime out, may be you choose or enter a incorrect version. :(";
}
}
else
{
code = "-2";
- msg = "无法安装密钥,可能没有选择或输入正确的版本 :(\nCannot to install key, may be you choose or enter a incorrect version. :(";
+ msg = (string)this.Resources["ErrorMsg-2"]; // "无法安装密钥,可能没有选择或输入正确的版本 :(\nCannot to install key, may be you choose or enter a incorrect version. :(";
}
}
else
{
code = "-1";
- msg = "无法卸载旧密钥 :(\nCannot to uninstall old key. :(";
+ msg = (string)this.Resources["ErrorMsg-1"]; // "无法卸载旧密钥 :(\nCannot to uninstall old key. :(";
}
- //string runend = RunCScript(slmgr_self, "-upk").Trim();
- EndLine:;
+ //string runend = RunCScript(slmgr_self, "-upk").Trim();
+ EndLine:;
if (code != "200")
{
actbtn.Dispatcher.Invoke(new Action(() =>
{
this.DialogActProg.IsOpen = false;
- this.activatingtext.Text = "Activating";
+ this.activatingtext.Text = (string)this.Resources["RunAct_Activating"]; //提示激活中
this.DialogWithOKToCloseDialog.IsOpen = true;
- this.DialogWithOKToCloseDialogTitle.Text = "Error";
- this.DialogWithOKToCloseDialogText.Text = msg + "\r\nCode:" + code;
+ this.DialogWithOKToCloseDialogTitle.Text = (string)this.Resources["ErrorTitle"]; //错误标题
+ this.DialogWithOKToCloseDialogText.Text = msg + "\r\n" + (string)this.Resources["ErrorCode"] + code; //错误代码 如:错误信息\r\nCode:000
if (hiderun == true && autoact == true)
{
int tipShowMilliseconds = 0;
- string tipTitle = "CloudMoe Windows 10 Activation Toolkit V2";
+ string tipTitle = (string)this.Resources["notifyIconTitle"];
string tipContent = msg;
ToolTipIcon tipType = ToolTipIcon.None;
notifyIcon.ShowBalloonTip(tipShowMilliseconds, tipTitle, tipContent, tipType);
@@ -838,15 +1050,15 @@ namespace CMWTAT_DIGITAL
actbtn.Dispatcher.Invoke(new Action(() =>
{
this.DialogActProg.IsOpen = false;
- this.activatingtext.Text = "Activating";
+ this.activatingtext.Text = (string)this.Resources["RunAct_Activating"]; //提示激活中
this.DialogWithOKToCloseDialogDonate.IsOpen = true;
- this.DialogWithOKToCloseDialogDonateTitle.Text = "Complete";
- this.DialogWithOKToCloseDialogDonateText.Text = "\nCongratulation! \n\nWindows 10 has been successful activated.\n";
+ this.DialogWithOKToCloseDialogDonateTitle.Text = (string)this.Resources["CompleteTitle"]; //完成标题
+ this.DialogWithOKToCloseDialogDonateText.Text = (string)this.Resources["DonateTextActivated"]; //完成转换内容
if (hiderun == true && autoact == true)
{
int tipShowMilliseconds = 0;
- string tipTitle = "CloudMoe Windows 10 Activation Toolkit V2";
- string tipContent = "Congratulation!\nWindows 10 has been successful activated.";
+ string tipTitle = (string)this.Resources["notifyIconTitle"];
+ string tipContent = this.DialogWithOKToCloseDialogDonateText.Text;
ToolTipIcon tipType = ToolTipIcon.None;
notifyIcon.ShowBalloonTip(tipShowMilliseconds, tipTitle, tipContent, tipType);
Exit_Button_Click(null, null);
@@ -936,7 +1148,7 @@ namespace CMWTAT_DIGITAL
private void Donate_Button_Click(object sender, RoutedEventArgs e)
{
- System.Diagnostics.Process.Start("https://waxel.cloudmoe.com/donate/");
+ System.Diagnostics.Process.Start("https://cmwtat.cloudmoe.com/donate"); // 打开捐赠页
this.DialogWithOKToCloseDialogDonate.IsOpen = false;
}
@@ -955,6 +1167,38 @@ namespace CMWTAT_DIGITAL
last_key = SystemEditionTextInput.Text;
SystemEditionTextInput.SelectionStart = SystemEditionTextInput.Text.Length;
}
+ UpdateInputMatch(); // 更新按钮启用状态
+ }
+
+ ///
+ /// 验证产品密钥字符串是否匹配正则表达式描述的规则并更新按钮状态(如果自动模式则启用按钮)
+ ///
+ private void UpdateInputMatch()
+ {
+ //防止初始化前访问null出错
+ try
+ {
+ string pattern = @"^[a-zA-Z0-9]{5}-[a-zA-Z0-9]{5}-[a-zA-Z0-9]{5}-[a-zA-Z0-9]{5}-[a-zA-Z0-9]{5}$";
+ if (is_auto == false)
+ {
+ if (CMWTAT_DIGITAL.Domain.IsSN.IsMatch((SystemEditionTextInput.Text ?? "").ToString(), pattern))
+ {
+ actbtn.IsEnabled = true;
+ installbtn.IsEnabled = true;
+ }
+ else
+ {
+ actbtn.IsEnabled = false;
+ installbtn.IsEnabled = false;
+ }
+ }
+ else
+ {
+ actbtn.IsEnabled = true;
+ installbtn.IsEnabled = true;
+ }
+ }
+ catch { }
}
private void A_RadioButton_Checked(object sender, RoutedEventArgs e)
@@ -962,6 +1206,7 @@ namespace CMWTAT_DIGITAL
SystemEditionText.Visibility = Visibility.Visible;
SystemEditionTextInput.Visibility = Visibility.Hidden;
is_auto = true;
+ UpdateInputMatch(); // 更新按钮启用状态
}
private void M_RadioButton_Checked(object sender, RoutedEventArgs e)
@@ -969,6 +1214,7 @@ namespace CMWTAT_DIGITAL
SystemEditionText.Visibility = Visibility.Hidden;
SystemEditionTextInput.Visibility = Visibility.Visible;
is_auto = false;
+ UpdateInputMatch(); // 更新按钮启用状态
}
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
@@ -976,5 +1222,10 @@ namespace CMWTAT_DIGITAL
DelectTempFile();
notifyIcon.Visible = false;
}
+
+ private void UpdateBtn_Click(object sender, RoutedEventArgs e)
+ {
+ System.Diagnostics.Process.Start("https://cmwtat.cloudmoe.com"); // 打开官网
+ }
}
}
diff --git a/CMWTAT_DIGITAL/Properties/AssemblyInfo.cs b/CMWTAT_DIGITAL/Properties/AssemblyInfo.cs
index 7e8aa51..6c72bb9 100644
--- a/CMWTAT_DIGITAL/Properties/AssemblyInfo.cs
+++ b/CMWTAT_DIGITAL/Properties/AssemblyInfo.cs
@@ -51,5 +51,5 @@ using System.Windows;
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
// 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("2.2.0.1")]
-[assembly: AssemblyFileVersion("2.2.0.1")]
+[assembly: AssemblyVersion("2.3.0.0")]
+[assembly: AssemblyFileVersion("2.3.0.0")]
diff --git a/CMWTAT_DIGITAL/Properties/Settings.Designer.cs b/CMWTAT_DIGITAL/Properties/Settings.Designer.cs
index bacea9b..bbb5524 100644
--- a/CMWTAT_DIGITAL/Properties/Settings.Designer.cs
+++ b/CMWTAT_DIGITAL/Properties/Settings.Designer.cs
@@ -12,7 +12,7 @@ namespace CMWTAT_DIGITAL.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.5.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.7.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
diff --git a/CMWTAT_DIGITAL/app.config b/CMWTAT_DIGITAL/app.config
index 51278a4..ff99501 100644
--- a/CMWTAT_DIGITAL/app.config
+++ b/CMWTAT_DIGITAL/app.config
@@ -1,3 +1,3 @@
-
+
diff --git a/CMWTAT_Digital_Release_2_0_0_0.exe b/CMWTAT_Digital_Release_2_0_0_0.exe
deleted file mode 100644
index d9592f1..0000000
Binary files a/CMWTAT_Digital_Release_2_0_0_0.exe and /dev/null differ
diff --git a/CMWTAT_Digital_Release_2_1_0_0.exe b/CMWTAT_Digital_Release_2_1_0_0.exe
deleted file mode 100644
index c322967..0000000
Binary files a/CMWTAT_Digital_Release_2_1_0_0.exe and /dev/null differ
diff --git a/CMWTAT_Digital_Release_2_2_1_0.exe b/CMWTAT_Digital_Release_2_3_0_0.exe
similarity index 99%
rename from CMWTAT_Digital_Release_2_2_1_0.exe
rename to CMWTAT_Digital_Release_2_3_0_0.exe
index 9358912..5df697a 100644
Binary files a/CMWTAT_Digital_Release_2_2_1_0.exe and b/CMWTAT_Digital_Release_2_3_0_0.exe differ