Showing preview only (254K chars total). Download the full file or copy to clipboard to get everything.
Repository: TGSAN/CMWTAT_Digital_Edition
Branch: master
Commit: 2bab2dfd5734
Files: 34
Total size: 242.7 KB
Directory structure:
gitextract_3jvuoj2b/
├── .gitattributes
├── .github/
│ └── ISSUE_TEMPLATE/
│ └── bug_report.md
├── .gitignore
├── CDNDirectRun.ps1
├── CMWTAT_DIGITAL/
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── CMWTAT_DIGITAL.csproj
│ ├── Domain/
│ │ ├── IsSN.cs
│ │ ├── NotifyPropertyChangedExtension.cs
│ │ └── ViewModel.cs
│ ├── FodyWeavers.xml
│ ├── Lang/
│ │ ├── en.xaml
│ │ ├── fr.xaml
│ │ ├── ja.xaml
│ │ ├── ru.xaml
│ │ └── zh.xaml
│ ├── MainWindow.xaml
│ ├── MainWindow.xaml.cs
│ ├── OSVersionInfoClass.cs
│ ├── Properties/
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.resx
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
│ ├── app.config
│ ├── app.manifest
│ └── packages.config
├── CMWTAT_DIGITAL.sln
├── DirectRun.ps1
├── LICENSE
├── README.en.md
├── README.md
├── README.zh.md
└── _config.yml
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitattributes
================================================
# Auto detect text files and perform LF normalization
* text=auto
================================================
FILE: .github/ISSUE_TEMPLATE/bug_report.md
================================================
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**PC Information (please complete the following information):**
- CPU Arch: [e.g. x86/x64/ARM64]
- Windows Version: [e.g. Windows 10 10.0.10240.0]
- Original SKU: [e.g. Home/Pro/Education etc.]
- Target SKU: [e.g. Home/Pro/Education etc.]
- Version [e.g. 2.6.2.0]
**Additional context**
Add any other context about the problem here.
================================================
FILE: .gitignore
================================================
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Mono auto generated files
mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
[Ll]ogs/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.tlog
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio 6 auto-generated project file (contains which files were open etc.)
*.vbp
# Visual Studio 6 workspace and project file (working project files containing files to include in project)
*.dsw
*.dsp
# Visual Studio 6 technical files
*.ncb
*.aps
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# Visual Studio History (VSHistory) files
.vshistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd
# VS Code files for those working on multiple tools
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace
# Local History for Visual Studio Code
.history/
# Windows Installer files from build outputs
*.cab
*.msi
*.msix
*.msm
*.msp
# JetBrains Rider
*.sln.iml
================================================
FILE: CDNDirectRun.ps1
================================================
$isAdmin = (New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
if (-not $isAdmin) {
Start-Process powershell -ArgumentList "irm https://fastly.jsdelivr.net/gh/TGSAN/CMWTAT_Digital_Edition/CDNDirectRun.ps1 | iex" -Verb RunAs
Exit
}
# $exePath = ".\CMWTAT_DIGITAL\bin\Debug\CMWTAT_DIGITAL.exe"
# $exeBytes = [System.IO.File]::ReadAllBytes($exePath)
# $bytes = $exeBytes
$bytes = (Invoke-WebRequest "https://release-download.static.cloudmoe.com/TGSAN/CMWTAT_Digital_Edition/releases/download/2.7.2.0/CMWTAT_Digital_Release_2_7_2_0.exe").Content
$assembly = [System.Reflection.Assembly]::Load($bytes)
$entryPointMethod = $assembly.EntryPoint
$entryPointMethod.Invoke($null, @())
================================================
FILE: CMWTAT_DIGITAL/App.xaml
================================================
<Application x:Class="CMWTAT_DIGITAL.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:CMWTAT_DIGITAL"
StartupUri="MainWindow.xaml"
>
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Dark.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.Pink.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.Lime.xaml" />
<ResourceDictionary Source="Lang/en.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
================================================
FILE: CMWTAT_DIGITAL/App.xaml.cs
================================================
using System;
using System.Windows;
namespace CMWTAT_DIGITAL
{
/// <summary>
/// App.xaml 的交互逻辑
/// </summary>
public partial class App : Application
{
public static bool autoact = false;
public static bool hiderun = false;
public static bool expact = false;
public static bool log2file = false;
public static bool showhelp = false;
protected override void OnStartup(StartupEventArgs e)
{
foreach (string arg in e.Args)
{
Console.WriteLine("arg: " + arg);
if (arg == "-a" || arg == "--auto")
{
Console.WriteLine("AUTO: True");
autoact = true;
}
if (arg == "-h" || arg == "--hide")
{
Console.WriteLine("HIDE: True");
hiderun = true;
}
if (arg == "-e" || arg == "--expact")
{
Console.WriteLine("EXPACT: True");
expact = true;
}
if (arg == "-l" || arg == "--log")
{
Console.WriteLine("LOG: True");
log2file = true;
}
if (arg == "-?" || arg == "--help")
{
Console.WriteLine("SHOWHELP: True");
showhelp = true;
}
}
base.OnStartup(e);
}
}
}
================================================
FILE: CMWTAT_DIGITAL/CMWTAT_DIGITAL.csproj
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Costura.Fody.4.1.0\build\Costura.Fody.props" Condition="Exists('..\packages\Costura.Fody.4.1.0\build\Costura.Fody.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<TargetPlatformVersion>10.0.10240.0</TargetPlatformVersion>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{961DE925-B82C-4515-8FBD-6805E36D1212}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>CMWTAT_DIGITAL</RootNamespace>
<AssemblyName>CMWTAT_DIGITAL</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<TargetFrameworkProfile />
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>CMWTAT.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup>
<StartupObject>
</StartupObject>
</PropertyGroup>
<ItemGroup>
<Reference Include="Costura, Version=4.1.0.0, Culture=neutral, PublicKeyToken=9919ef960d84173d, processorArchitecture=MSIL">
<HintPath>..\packages\Costura.Fody.4.1.0\lib\net40\Costura.dll</HintPath>
</Reference>
<Reference Include="MaterialDesignColors, Version=2.0.6.0, Culture=neutral, PublicKeyToken=df2a72020bd7962a, processorArchitecture=MSIL">
<HintPath>..\packages\MaterialDesignColors.2.0.6\lib\net452\MaterialDesignColors.dll</HintPath>
</Reference>
<Reference Include="MaterialDesignThemes.Wpf, Version=4.5.0.0, Culture=neutral, PublicKeyToken=df2a72020bd7962a, processorArchitecture=MSIL">
<HintPath>..\packages\MaterialDesignThemes.4.5.0\lib\net452\MaterialDesignThemes.Wpf.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Drawing" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Numerics" />
<Reference Include="System.Runtime" />
<Reference Include="System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.InteropServices.WindowsRuntime" />
<Reference Include="System.Runtime.WindowsRuntime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" />
<Reference Include="Windows.Data" />
<Reference Include="Windows.Foundation" />
<Reference Include="Windows.UI" />
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Page Include="Lang\en.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Lang\ja.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Lang\fr.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Lang\ru.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Lang\zh.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="Domain\IsSN.cs" />
<Compile Include="Domain\NotifyPropertyChangedExtension.cs" />
<Compile Include="Domain\ViewModel.cs" />
<Compile Include="MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<Compile Include="OSVersionInfoClass.cs" />
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<None Include="app.config" />
<None Include="app.manifest">
<SubType>Designer</SubType>
</None>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<Resource Include="CMWTAT.ico" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<None Include="Res\slmgr.vbs" />
</ItemGroup>
<ItemGroup>
<Folder Include="bin\Debug\" />
</ItemGroup>
<ItemGroup>
<Content Include="Res\ClipUp.exe" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Costura.Fody.4.1.0\build\Costura.Fody.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Costura.Fody.4.1.0\build\Costura.Fody.props'))" />
<Error Condition="!Exists('..\packages\Fody.6.9.1\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.6.9.1\build\Fody.targets'))" />
<Error Condition="!Exists('..\packages\MaterialDesignThemes.4.5.0\build\MaterialDesignThemes.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MaterialDesignThemes.4.5.0\build\MaterialDesignThemes.targets'))" />
</Target>
<Import Project="..\packages\Fody.6.9.1\build\Fody.targets" Condition="Exists('..\packages\Fody.6.9.1\build\Fody.targets')" />
<Import Project="..\packages\MaterialDesignThemes.4.5.0\build\MaterialDesignThemes.targets" Condition="Exists('..\packages\MaterialDesignThemes.4.5.0\build\MaterialDesignThemes.targets')" />
</Project>
================================================
FILE: CMWTAT_DIGITAL/Domain/IsSN.cs
================================================
using System.Globalization;
using System.Text.RegularExpressions;
using System.Windows.Controls;
namespace CMWTAT_DIGITAL.Domain
{
class IsSN : ValidationRule
{
#region 匹配方法
/// <summary>
/// 验证字符串是否匹配正则表达式描述的规则
/// </summary>
/// <param name="inputStr">待验证的字符串</param>
/// <param name="patternStr">正则表达式字符串</param>
/// <returns>是否匹配</returns>
public static bool IsMatch(string inputStr, string patternStr)
{
return IsMatch(inputStr, patternStr, false, false);
}
/// <summary>
/// 验证字符串是否匹配正则表达式描述的规则
/// </summary>
/// <param name="inputStr">待验证的字符串</param>
/// <param name="patternStr">正则表达式字符串</param>
/// <param name="ifIgnoreCase">匹配时是否不区分大小写</param>
/// <returns>是否匹配</returns>
public static bool IsMatch(string inputStr, string patternStr, bool ifIgnoreCase)
{
return IsMatch(inputStr, patternStr, ifIgnoreCase, false);
}
/// <summary>
/// 验证字符串是否匹配正则表达式描述的规则
/// </summary>
/// <param name="inputStr">待验证的字符串</param>
/// <param name="patternStr">正则表达式字符串</param>
/// <param name="ifIgnoreCase">匹配时是否不区分大小写</param>
/// <param name="ifValidateWhiteSpace">是否验证空白字符串</param>
/// <returns>是否匹配</returns>
public static bool IsMatch(string inputStr, string patternStr, bool ifIgnoreCase, bool ifValidateWhiteSpace)
{
if (!ifValidateWhiteSpace && string.IsNullOrEmpty(inputStr))
return false;//如果不要求验证空白字符串而此时传入的待验证字符串为空白字符串,则不匹配
Regex regex = null;
if (ifIgnoreCase)
regex = new Regex(patternStr, RegexOptions.IgnoreCase);//指定不区分大小写的匹配
else
regex = new Regex(patternStr);
return regex.IsMatch(inputStr);
}
#endregion
public override ValidationResult Validate(object value, CultureInfo cultureInfo)
{
//Console.WriteLine("\""+value+"\"");
//return string.IsNullOrWhiteSpace((value ?? "").ToString())
// ? new ValidationResult(false, "Key is required.")
// : ValidationResult.ValidResult;
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 (IsMatch((value ?? "").ToString(), pattern))
{
return ValidationResult.ValidResult;
}
else if (string.IsNullOrWhiteSpace((value ?? "").ToString()))
{
return new ValidationResult(false, "Please enter the key for the current edition.");
}
else
{
return new ValidationResult(false, "Invalid format.");
}
}
}
}
================================================
FILE: CMWTAT_DIGITAL/Domain/NotifyPropertyChangedExtension.cs
================================================
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace CMWTAT_DIGITAL.Domain
{
public static class NotifyPropertyChangedExtension
{
public static void MutateVerbose<TField>(this INotifyPropertyChanged instance, ref TField field, TField newValue, Action<PropertyChangedEventArgs> raise, [CallerMemberName] string propertyName = null)
{
if (EqualityComparer<TField>.Default.Equals(field, newValue)) return;
field = newValue;
raise?.Invoke(new PropertyChangedEventArgs(propertyName));
}
}
}
================================================
FILE: CMWTAT_DIGITAL/Domain/ViewModel.cs
================================================
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
namespace CMWTAT_DIGITAL.Domain
{
class ViewModel : INotifyPropertyChanged
{
private string _sn;
public ViewModel()
{
LongListToTestComboVirtualization = new List<int>(Enumerable.Range(0, 1000));
}
public string SN
{
get { return _sn; }
set
{
this.MutateVerbose(ref _sn, value, RaisePropertyChanged());
}
}
public IList<int> LongListToTestComboVirtualization { get; }
public event PropertyChangedEventHandler PropertyChanged;
private Action<PropertyChangedEventArgs> RaisePropertyChanged()
{
return args => PropertyChanged?.Invoke(this, args);
}
}
}
================================================
FILE: CMWTAT_DIGITAL/FodyWeavers.xml
================================================
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<Costura />
</Weavers>
================================================
FILE: CMWTAT_DIGITAL/Lang/en.xaml
================================================
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sys="clr-namespace:System;assembly=mscorlib">
<!--
Version: 2.6.0.0
-->
<!--FontFamily Dictionary-->
<FontFamily x:Key="Font">
Roboto
</FontFamily>
<!--String Dictionary-->
<sys:String x:Key="OK">
OK
</sys:String>
<sys:String x:Key="Cancel">
Cancel
</sys:String>
<sys:String x:Key="Refuse">
Refuse
</sys:String>
<sys:String x:Key="DonateBtn">
Thanks developer and donate a dinner
</sys:String>
<sys:String x:Key="Exit">
Exit
</sys:String>
<sys:String x:Key="UpdateNow">
Update Now
</sys:String>
<sys:String x:Key="Ignore">
Ignore
</sys:String>
<sys:String x:Key="TitleName">
CMWTAT Digital Edition
</sys:String>
<sys:String x:Key="AppName">
CMWTAT Digital Edition V2
</sys:String>
<sys:String x:Key="UpdateTitle">
A new version available!
</sys:String>
<sys:String x:Key="UpgradeFullVersionWindowsTitle">
Upgrade to full version of Windows
</sys:String>
<sys:String x:Key="CurrentVersion">
Current Version
</sys:String>
<sys:String x:Key="LatestVersion">
Latest Version
</sys:String>
<sys:String x:Key="Auto_Mode">
Auto Mode
</sys:String>
<sys:String x:Key="Manual_Mode">
Manual Mode
</sys:String>
<sys:String x:Key="Activate_Button">
Activate
</sys:String>
<sys:String x:Key="Convert_versions">
Convert versions (Install Key without Activate)
</sys:String>
<sys:String x:Key="Upgrade_full_version">
Upgrade to full version of Windows
</sys:String>
<sys:String x:Key="test">
Test Text
</sys:String>
<sys:String x:Key="Loading">
Loading
</sys:String>
<sys:String x:Key="Activating">
Activating
</sys:String>
<sys:String x:Key="Complete">
Complete
</sys:String>
<sys:String x:Key="notifyIconTitle">
CloudMoe Windows 10+ Activation Toolkit V2
</sys:String>
<sys:String x:Key="Running">
Running.
</sys:String>
<sys:String x:Key="Experimental">
Experimental
</sys:String>
<sys:String x:Key="Attention">
Attention
</sys:String>
<sys:String x:Key="System_Edition">
System edition
</sys:String>
<sys:String x:Key="May_be_not_be_supported">
Unable to correctly identify your operating system edition in support list, may be not be supported.
</sys:String>
<sys:String x:Key="Only_find_experimental">
Only found experimental options that can be used with this operating system edition, little hope of activation success.
</sys:String>
<sys:String x:Key="notify_May_be_not_be_supported_try">
Your system edition may not be supported, program will exit. you can try add --expact or -e to startup.
</sys:String>
<sys:String x:Key="notify_May_be_not_be_supported_exit">
Your system edition may not be supported, program will exit.
</sys:String>
<sys:String x:Key="notify_Disconnect_to_server_exit">
Unable to connect to server, Please check the network and try to try again later, program will exit.
</sys:String>
<sys:String x:Key="Disconnect_to_server_exit">
Unable to connect to server, Please check the network and try to try again later, program will exit.
</sys:String>
<sys:String x:Key="RunInstall_Converting">
Converting
</sys:String>
<sys:String x:Key="RunAct_Activating">
Activating
</sys:String>
<sys:String x:Key="RunInstall_Getting_Key">
Getting Key via Internet
</sys:String>
<sys:String x:Key="RunAct_Getting_Key">
Getting Key via Internet
</sys:String>
<sys:String x:Key="RunInstall_Uninstalling_old_Key">
Uninstalling old Key
</sys:String>
<sys:String x:Key="RunAct_Uninstalling_old_Key">
Uninstalling old Key
</sys:String>
<sys:String x:Key="RunAct_Uninstalling_old_Key_Exp">
Uninstalling old Key (Experimental)
</sys:String>
<sys:String x:Key="RunInstall_Installing_Key">
Installing Key
</sys:String>
<sys:String x:Key="RunAct_Installing_Key">
Installing Key
</sys:String>
<sys:String x:Key="RunAct_Getting_edition_code_Exp">
Getting edition code (Experimental)
</sys:String>
<sys:String x:Key="RunAct_Prepare_for_the_next_step_Exp">
Prepare for the next step (Experimental)
</sys:String>
<sys:String x:Key="RunAct_Writing_old_OS">
Writing feature of old Windows version
</sys:String>
<sys:String x:Key="RunAct_Getting_free_upgrade_permissions">
Getting free upgrade permissions
</sys:String>
<sys:String x:Key="RunAct_Cleaning_changes">
Cleaning changes
</sys:String>
<sys:String x:Key="RunAct_Getting_digital_license">
Getting digital license
</sys:String>
<sys:String x:Key="RunUpgradeFullVersion_Upgrading">
Upgrading
</sys:String>
<sys:String x:Key="CompleteTitle">
Complete
</sys:String>
<sys:String x:Key="ErrorTitle">
Error
</sys:String>
<sys:String x:Key="ErrorCode">
Code:
</sys:String>
<sys:String x:Key="SysMsg">
System return:
</sys:String>
<!--
Attention:
DO NOT USE ANY Indentation in Preserve Mode, Please!
-->
<sys:String x:Key="UpgradeFullVersionWindowsText" xml:space="preserve">
You are currently using the core version of Windows, you can use this feature to upgrade to the full version of Windows. (If the operation does not respond it may be that the current version does not support the upgrade or is in the process of upgrading) Note: This operation is not reversible and once the upgrade is complete you will not be able to roll back to the core version of Windows! Are you sure you want to perform an upgrade?
</sys:String>
<sys:String x:Key="HelpText" xml:space="preserve">
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. -l	--log		Output log to file. -?	--help		Show this help Dialog.
</sys:String>
<sys:String x:Key="DonateTextConverted" xml:space="preserve">
Congratulation! Windows has been successful converted.
</sys:String>
<sys:String x:Key="DonateTextActivated" xml:space="preserve">
Congratulation! Windows has been successful activated.
</sys:String>
<sys:String x:Key="UpdateText" xml:space="preserve">
We found a new version for CloudMoe Windows 10+ Activation Toolkit Digital Edition. Please update to the latest version to make sure it works.
</sys:String>
<sys:String x:Key="UpdateMustText" xml:space="preserve">
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.
</sys:String>
<sys:String x:Key="ErrorMsg-0" xml:space="preserve">
Activate Windows requires a network to gets the product key :)
</sys:String>
<sys:String x:Key="ErrorMsg-1" xml:space="preserve">
Cannot to uninstall old key. :(
</sys:String>
<sys:String x:Key="ErrorMsg-1.1" xml:space="preserve">
Cannot to install key, may be you choose or enter a incorrect version. :(
</sys:String>
<sys:String x:Key="ErrorMsg-1.2" xml:space="preserve">
Cannot to get edition code. :(
</sys:String>
<sys:String x:Key="ErrorMsg-2" xml:space="preserve">
Cannot to install key, may be you choose or enter a incorrect version. :(
</sys:String>
<sys:String x:Key="ErrorMsg-3" xml:space="preserve">
Time out, may be you choose or enter a incorrect version. :(
</sys:String>
<sys:String x:Key="ErrorMsg-4" xml:space="preserve">
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.
</sys:String>
<sys:String x:Key="Only_find_ltok" xml:space="preserve">
Only found Long-Term Offline KMS (LTOK) options that can be used with this operating system edition. This means that it will not be activate automatically after you reinstalled the system. But don't worry, this is different from the legacy KMS activation method (it can keep activating for 180 days in offline environment). LTOK (The prefix is Offline-KMS) can keep activating for up to 2038 even it is without networking!
</sys:String>
<sys:String x:Key="DonateTextWillActivated" xml:space="preserve">
Congratulation! Windows is ready to activate. However, it seems that Windows cannot connect to the Microsoft Activation Server. Your system will be activated automatically the next time the server is connected.
</sys:String>
</ResourceDictionary>
================================================
FILE: CMWTAT_DIGITAL/Lang/fr.xaml
================================================
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sys="clr-namespace:System;assembly=mscorlib">
<!--
Version: 2.5.0.0
-->
<!--FontFamily Dictionary-->
<FontFamily x:Key="Font">
Roboto
</FontFamily>
<!--String Dictionary-->
<sys:String x:Key="OK">
Ok
</sys:String>
<sys:String x:Key="Cancel">
Annuler
</sys:String>
<sys:String x:Key="Refuse">
Refuser
</sys:String>
<sys:String x:Key="DonateBtn">
Remerciez les développeurs et offrez leurs un café
</sys:String>
<sys:String x:Key="Exit">
Sortir
</sys:String>
<sys:String x:Key="UpdateNow">
Mettre à jour maintenant
</sys:String>
<sys:String x:Key="Ignore">
Ignorer
</sys:String>
<sys:String x:Key="TitleName">
CMWTAT Edition numérique
</sys:String>
<sys:String x:Key="AppName">
CMWTAT Edition numérique V2
</sys:String>
<sys:String x:Key="UpdateTitle">
Une nouvelle version disponible !
</sys:String>
<sys:String x:Key="CurrentVersion">
Version actuelle
</sys:String>
<sys:String x:Key="LatestVersion">
Dernière version
</sys:String>
<sys:String x:Key="Auto_Mode">
Mode automatique
</sys:String>
<sys:String x:Key="Manual_Mode">
Mode manuel
</sys:String>
<sys:String x:Key="Activate_Button">
Activer
</sys:String>
<sys:String x:Key="Convert_versions">
Convertir la versions (Installer la clé sans l'activer)
</sys:String>
<sys:String x:Key="test">
Texte de test
</sys:String>
<sys:String x:Key="Loading">
Chargement
</sys:String>
<sys:String x:Key="Activating">
Activation
</sys:String>
<sys:String x:Key="Complete">
Terminé
</sys:String>
<sys:String x:Key="notifyIconTitle">
CloudMoe Windows 10+ Activation Toolkit V2
</sys:String>
<sys:String x:Key="Running">
En cours d'exécution.
</sys:String>
<sys:String x:Key="Experimental">
Expérimental
</sys:String>
<sys:String x:Key="Attention">
Attention
</sys:String>
<sys:String x:Key="System_Edition">
Version du système
</sys:String>
<sys:String x:Key="May_be_not_be_supported">
La version de votre système d'exploitation n'est pas identifiable, il se peut qu'il ne soit pas supporté.
</sys:String>
<sys:String x:Key="Only_find_experimental">
Seules des options expérimentales peuvent être utilisées avec cette édition du système d'exploitation. Il y a peu d'espoir de succès d'activation.
</sys:String>
<sys:String x:Key="notify_May_be_not_be_supported_try">
La version de votre système peut ne pas être supportée, le programme se terminera automatiquement. Vous pouvez essayer d'ajouter --expact ou -e au démarrage.
</sys:String>
<sys:String x:Key="notify_May_be_not_be_supported_exit">
La version de votre système peut ne pas être prise en charge, le programme va se fermer.
</sys:String>
<sys:String x:Key="notify_Disconnect_to_server_exit">
Impossible de se connecter au serveur, Veuillez vérifier le réseau et réessayer plus tard, le programme va se fermer.
</sys:String>
<sys:String x:Key="Disconnect_to_server_exit">
Impossible de se connecter au serveur, Veuillez vérifier le réseau et réessayer plus tard, le programme va se fermer.
</sys:String>
<sys:String x:Key="RunInstall_Converting">
Conversion
</sys:String>
<sys:String x:Key="RunAct_Activating">
Activation
</sys:String>
<sys:String x:Key="RunInstall_Getting_Key">
Obtention de la clé par Internet
</sys:String>
<sys:String x:Key="RunAct_Getting_Key">
Obtention de la clé par Internet
</sys:String>
<sys:String x:Key="RunInstall_Uninstalling_old_Key">
Suppression de l'ancienne clé
</sys:String>
<sys:String x:Key="RunAct_Uninstalling_old_Key">
Suppression de l'ancienne clé
</sys:String>
<sys:String x:Key="RunAct_Uninstalling_old_Key_Exp">
Suppression de l'ancienne clé (Experimental)
</sys:String>
<sys:String x:Key="RunInstall_Installing_Key">
Installation de la clé
</sys:String>
<sys:String x:Key="RunAct_Installing_Key">
Installation de la clé
</sys:String>
<sys:String x:Key="RunAct_Getting_edition_code_Exp">
Obtenir le code version (Experimental)
</sys:String>
<sys:String x:Key="RunAct_Prepare_for_the_next_step_Exp">
Préparation à l'étape suivante (Experimental)
</sys:String>
<sys:String x:Key="RunAct_Writing_old_OS">
Écriture d'une ancienne version de Windows
</sys:String>
<sys:String x:Key="RunAct_Getting_free_upgrade_permissions">
Obtention des autorisations gratuite de mise à niveau
</sys:String>
<sys:String x:Key="RunAct_Cleaning_changes">
Nettoyage des changements
</sys:String>
<sys:String x:Key="RunAct_Getting_digital_license">
Obtention d'une licence numérique
</sys:String>
<sys:String x:Key="CompleteTitle">
Terminé
</sys:String>
<sys:String x:Key="ErrorTitle">
Erreur
</sys:String>
<sys:String x:Key="ErrorCode">
Code:
</sys:String>
<sys:String x:Key="SysMsg">
Le système à retourné:
</sys:String>
<!--
Attention:
DO NOT USE ANY Indentation in Preserve Mode, Please!
-->
<!--
TODO: Finish the above translation
-->
<sys:String x:Key="HelpText" xml:space="preserve">
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. -l	--log		Output log to file. -?	--help		Show this help Dialog.
</sys:String>
<sys:String x:Key="DonateTextConverted" xml:space="preserve">
Congratulation! Windows has been successful converted.
</sys:String>
<sys:String x:Key="DonateTextActivated" xml:space="preserve">
Congratulation! Windows has been successful activated.
</sys:String>
<sys:String x:Key="UpdateText" xml:space="preserve">
We found a new version for CloudMoe Windows 10+ Activation Toolkit Digital Edition. Please update to the latest version to make sure it works.
</sys:String>
<sys:String x:Key="UpdateMustText" xml:space="preserve">
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.
</sys:String>
<sys:String x:Key="ErrorMsg-0" xml:space="preserve">
Activate Windows requires a network to gets the product key :)
</sys:String>
<sys:String x:Key="ErrorMsg-1" xml:space="preserve">
Cannot to uninstall old key. :(
</sys:String>
<sys:String x:Key="ErrorMsg-1.1" xml:space="preserve">
Cannot to install key, may be you choose or enter a incorrect version. :(
</sys:String>
<sys:String x:Key="ErrorMsg-1.2" xml:space="preserve">
Cannot to get edition code. :(
</sys:String>
<sys:String x:Key="ErrorMsg-2" xml:space="preserve">
Cannot to install key, may be you choose or enter a incorrect version. :(
</sys:String>
<sys:String x:Key="ErrorMsg-3" xml:space="preserve">
Time out, may be you choose or enter a incorrect version. :(
</sys:String>
<sys:String x:Key="ErrorMsg-4" xml:space="preserve">
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.
</sys:String>
<sys:String x:Key="Only_find_ltok" xml:space="preserve">
Only found Long-Term Offline KMS (LTOK) options that can be used with this operating system edition. This means that it will not be activate automatically after you reinstalled the system. But don't worry, this is different from the legacy KMS activation method (it can keep activating for 180 days in offline environment). LTOK (The prefix is Offline-KMS) can keep activating for up to 2038 even it is without networking!
</sys:String>
<sys:String x:Key="DonateTextWillActivated" xml:space="preserve">
Congratulation! Windows is ready to activate. However, it seems that Windows cannot connect to the Microsoft Activation Server. Your system will be activated automatically the next time the server is connected.
</sys:String>
</ResourceDictionary>
================================================
FILE: CMWTAT_DIGITAL/Lang/ja.xaml
================================================
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sys="clr-namespace:System;assembly=mscorlib">
<!--
Version: 2.6.0.0
-->
<!--FontFamily Dictionary-->
<FontFamily x:Key="Font">
Yu Gothic UI
</FontFamily>
<!--String Dictionary-->
<sys:String x:Key="OK">
はい
</sys:String>
<sys:String x:Key="Cancel">
キャンセル
</sys:String>
<sys:String x:Key="Refuse">
リフューズ
</sys:String>
<sys:String x:Key="DonateBtn">
寄付します
</sys:String>
<sys:String x:Key="Exit">
終了
</sys:String>
<sys:String x:Key="UpdateNow">
今すぐアップデート
</sys:String>
<sys:String x:Key="Ignore">
無視する
</sys:String>
<sys:String x:Key="TitleName">
雲萌 10+ デジタルライセンス認証アプリ
</sys:String>
<sys:String x:Key="AppName">
CMWTAT Digital Edition V2
</sys:String>
<sys:String x:Key="UpdateTitle">
新しいバージョンがあります!
</sys:String>
<!-- TODO -->
<sys:String x:Key="UpgradeFullVersionWindowsTitle">
Upgrade to full version of Windows
</sys:String>
<sys:String x:Key="CurrentVersion">
バージョン
</sys:String>
<sys:String x:Key="LatestVersion">
ラストバージョン
</sys:String>
<sys:String x:Key="Auto_Mode">
オートモード
</sys:String>
<sys:String x:Key="Manual_Mode">
マニュアルモード
</sys:String>
<sys:String x:Key="Activate_Button">
認証
</sys:String>
<sys:String x:Key="Convert_versions">
エディション変換 (キーをインストールするが、認証しません)
</sys:String>
<!-- TODO -->
<sys:String x:Key="Upgrade_full_version">
Upgrade to full version of Windows
</sys:String>
<sys:String x:Key="test">
テストテキスト
</sys:String>
<sys:String x:Key="Loading">
ローディング
</sys:String>
<sys:String x:Key="Activating">
認証中
</sys:String>
<sys:String x:Key="Complete">
コンプリート
</sys:String>
<sys:String x:Key="notifyIconTitle">
雲萌 Windows 10+ 認証アプリ V2
</sys:String>
<sys:String x:Key="Running">
実行中。
</sys:String>
<sys:String x:Key="Experimental">
実験性
</sys:String>
<sys:String x:Key="Attention">
注意
</sys:String>
<sys:String x:Key="System_Edition">
システムエディション
</sys:String>
<sys:String x:Key="May_be_not_be_supported">
あなたのシステムエディションが判別できません、対応していないかもしれません。
</sys:String>
<sys:String x:Key="Only_find_experimental">
このシステムエディションに実験性オプションしか取れません、認証成功の可能性は極めて低い。
</sys:String>
<sys:String x:Key="notify_May_be_not_be_supported_try">
あなたのシステムエディションは対応していないかもしれません。アプリは終了する。試して、--expactまたは-eを追加することでアプリ起動してください。
</sys:String>
<sys:String x:Key="notify_May_be_not_be_supported_exit">
あなたのシステムエディションは対応していないかもしれません。アプリは終了する。
</sys:String>
<sys:String x:Key="notify_Disconnect_to_server_exit">
サーバーに接続できません、インターネット接続を確認するまたは後で試してください、アプリは終了します。
</sys:String>
<sys:String x:Key="Disconnect_to_server_exit">
サーバーに接続できません、インターネット接続を確認するまたは後で試してください、アプリは終了します。
</sys:String>
<sys:String x:Key="RunInstall_Converting">
変換中
</sys:String>
<sys:String x:Key="RunAct_Activating">
ライセンス認証中
</sys:String>
<sys:String x:Key="RunInstall_Getting_Key">
インターネットを通じてキーを取得しています
</sys:String>
<sys:String x:Key="RunAct_Getting_Key">
インターネットを通じてキーを取得しています
</sys:String>
<sys:String x:Key="RunInstall_Uninstalling_old_Key">
以前のキーをアンインストールしています
</sys:String>
<sys:String x:Key="RunAct_Uninstalling_old_Key">
以前のキーをアンインストールしています
</sys:String>
<sys:String x:Key="RunAct_Uninstalling_old_Key_Exp">
以前のキーをアンインストールしています(実験性)
</sys:String>
<sys:String x:Key="RunInstall_Installing_Key">
キーをインストールしています
</sys:String>
<sys:String x:Key="RunAct_Installing_Key">
キーをインストールしています
</sys:String>
<sys:String x:Key="RunAct_Getting_edition_code_Exp">
エディションコードを取得中(実験性)
</sys:String>
<sys:String x:Key="RunAct_Prepare_for_the_next_step_Exp">
次のステップに準備しています(実験性)
</sys:String>
<sys:String x:Key="RunAct_Writing_old_OS">
旧システムの特徴を書き込み中
</sys:String>
<sys:String x:Key="RunAct_Getting_free_upgrade_permissions">
無償アップグレード権限を取得中
</sys:String>
<sys:String x:Key="RunAct_Cleaning_changes">
変更がクリーンアップされます
</sys:String>
<sys:String x:Key="RunAct_Getting_digital_license">
デジタルライセンスを取得中
</sys:String>
<!-- TODO -->
<sys:String x:Key="RunUpgradeFullVersion_Upgrading">
Upgrading
</sys:String>
<sys:String x:Key="CompleteTitle">
コンプリート
</sys:String>
<sys:String x:Key="ErrorTitle">
エラー
</sys:String>
<sys:String x:Key="ErrorCode">
コード:
</sys:String>
<sys:String x:Key="SysMsg">
システムメッセージ:
</sys:String>
<!--
Attention:
DO NOT USE ANY Indentation in Preserve Mode, Please!
-->
<!-- TODO -->
<sys:String x:Key="UpgradeFullVersionWindowsText" xml:space="preserve">
You are currently using the core version of Windows, you can use this feature to upgrade to the full version of Windows. (If the operation does not respond it may be that the current version does not support the upgrade or is in the process of upgrading) Note: This operation is not reversible and once the upgrade is complete you will not be able to roll back to the core version of Windows! Are you sure you want to perform an upgrade?
</sys:String>
<sys:String x:Key="HelpText" xml:space="preserve">
このアプリは起動時にコンソール引数を使用できるようになりました! -a	--auto		自動認証。 -h	--hide		非表示モードで実行 (-autoと一緒に使用するだけ可能)。 -e	--expact		実験性認証。 -l	--log		ログをファイルに出力。 -?	--help		この説明ダイアログボックスを表示する。
</sys:String>
<sys:String x:Key="DonateTextConverted" xml:space="preserve">
おめでとう! Windows エディション変換成功。
</sys:String>
<sys:String x:Key="DonateTextActivated" xml:space="preserve">
おめでとう! Windows 認証成功。
</sys:String>
<sys:String x:Key="UpdateText" xml:space="preserve">
雲萌 Windows 10+ デジタルライセンス認証アプリの新しいバージョン発見しました。 最新バージョンにアップデートしてください。
</sys:String>
<sys:String x:Key="UpdateMustText" xml:space="preserve">
雲萌 Windows 10+ デジタルライセンス認証アプリの新しいバージョン発見しました。 アプリが古すぎるため、最新バージョンにアップデートしてから利用ください。
</sys:String>
<sys:String x:Key="ErrorMsg-0" xml:space="preserve">
Windows ライセンス認証にはインターネットを通じてキーを取得する必要があります :)
</sys:String>
<sys:String x:Key="ErrorMsg-1" xml:space="preserve">
以前のキーをアンインストールできません :(
</sys:String>
<sys:String x:Key="ErrorMsg-1.1" xml:space="preserve">
キーをインストールできません、選択または入力されたエディションが間違っているかもしれません :(
</sys:String>
<sys:String x:Key="ErrorMsg-1.2" xml:space="preserve">
エディションコードを取得できません :(
</sys:String>
<sys:String x:Key="ErrorMsg-2" xml:space="preserve">
キーをインストールできません、選択または入力されたエディションが間違っているかもしれません :(
</sys:String>
<sys:String x:Key="ErrorMsg-3" xml:space="preserve">
タイムアウト,選択または入力されたエディションが間違っているかもしれません :(
</sys:String>
<sys:String x:Key="ErrorMsg-4" xml:space="preserve">
認証失敗。 :( 多分: 1. このエディション/バージョンの Windows はデジタルライセンス認証が適用しない。 2. マイクロソフトの認証サーバーに接続できません。 3. その他。 暫くお待ちくださいまたはあとでもう一度やり直してください。
</sys:String>
<sys:String x:Key="Only_find_ltok" xml:space="preserve">
このシステムエディションに適用されたのは長期オフラインKMS(LTOK)オプションしか見つかりません。これによってシステムを再インストールした時自動的にライセンス認証しませんが、心配する必要はありません。この方法(LTOK)でライセンス認証後、インターネット接続なしでも2038年まで稼働を継続できます!
</sys:String>
<sys:String x:Key="DonateTextWillActivated" xml:space="preserve">
おめでとうございます! Windowsはライセンス認証の準備が出来ています。 でも、マイクロソフトのライセンス認証サーバーに接続できませんみたいです。 システムは認証サーバーに接続出来る次第に自動的にライセンス認証します。
</sys:String>
</ResourceDictionary>
================================================
FILE: CMWTAT_DIGITAL/Lang/ru.xaml
================================================
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sys="clr-namespace:System;assembly=mscorlib">
<!--
Version: 2.6.0.0
-->
<!--FontFamily Dictionary-->
<FontFamily x:Key="Font">
Roboto
</FontFamily>
<!--String Dictionary-->
<sys:String x:Key="OK">
ОК
</sys:String>
<sys:String x:Key="Cancel">
Отменить
</sys:String>
<sys:String x:Key="Refuse">
Отказаться
</sys:String>
<sys:String x:Key="DonateBtn">
Поблагодарить и поддержать разработчика
</sys:String>
<sys:String x:Key="Exit">
Выйти
</sys:String>
<sys:String x:Key="UpdateNow">
Обновить сейчас
</sys:String>
<sys:String x:Key="Ignore">
Игнорировать
</sys:String>
<sys:String x:Key="TitleName">
CMWTAT Digital Edition
</sys:String>
<sys:String x:Key="AppName">
CMWTAT Digital Edition V2
</sys:String>
<sys:String x:Key="UpdateTitle">
Доступна новая версия!
</sys:String>
<sys:String x:Key="UpgradeFullVersionWindowsTitle">
Перейти на полную версию Windows
</sys:String>
<sys:String x:Key="CurrentVersion">
Текущая версия
</sys:String>
<sys:String x:Key="LatestVersion">
Последняя версия
</sys:String>
<sys:String x:Key="Auto_Mode">
Авто
</sys:String>
<sys:String x:Key="Manual_Mode">
Вручную
</sys:String>
<sys:String x:Key="Activate_Button">
Активировать
</sys:String>
<sys:String x:Key="Convert_versions">
Конвертировать версии (установить ключ без активации)
</sys:String>
<sys:String x:Key="Upgrade_full_version">
Перейти на полную версию Windows
</sys:String>
<sys:String x:Key="test">
тест текст
</sys:String>
<sys:String x:Key="Loading">
Загрузка
</sys:String>
<sys:String x:Key="Activating">
Активация
</sys:String>
<sys:String x:Key="Complete">
Готово
</sys:String>
<sys:String x:Key="notifyIconTitle">
CloudMoe Windows 10+ Activation Toolkit V2
</sys:String>
<sys:String x:Key="Running">
Работает
</sys:String>
<sys:String x:Key="Experimental">
Экспериментальный
</sys:String>
<sys:String x:Key="Attention">
Внимание
</sys:String>
<sys:String x:Key="System_Edition">
Версия системы
</sys:String>
<sys:String x:Key="May_be_not_be_supported">
Версия вашей системы не найдена. Возможно, она не поддерживается.
</sys:String>
<sys:String x:Key="Only_find_experimental">
Найдены только экспериментальные варианты для вашей системы. Скорее всего, активация завершится неудачей.
</sys:String>
<sys:String x:Key="notify_May_be_not_be_supported_try">
Версия вашей системы может не поддерживаться, программа завершает свою работу. Попробуйте добавить --expact или -e в качестве аргумента для запуска.
</sys:String>
<sys:String x:Key="notify_May_be_not_be_supported_exit">
Версия вашей системы может не поддерживаться, программа завершает свою работу.
</sys:String>
<sys:String x:Key="notify_Disconnect_to_server_exit">
Невозможно подключиться к серверу, проверьте подключение к интернету или попробуйте позже, программа завершает свою работу.
</sys:String>
<sys:String x:Key="Disconnect_to_server_exit">
Невозможно подключиться к серверу, проверьте подключение к интернету или попробуйте позже, программа завершает свою работу.
</sys:String>
<sys:String x:Key="RunInstall_Converting">
Конвертирую
</sys:String>
<sys:String x:Key="RunAct_Activating">
Активация
</sys:String>
<sys:String x:Key="RunInstall_Getting_Key">
Получаю ключ через интернет
</sys:String>
<sys:String x:Key="RunAct_Getting_Key">
Получаю ключ через интернет
</sys:String>
<sys:String x:Key="RunInstall_Uninstalling_old_Key">
Удаляю старый ключ
</sys:String>
<sys:String x:Key="RunAct_Uninstalling_old_Key">
Удаляю старый ключ
</sys:String>
<sys:String x:Key="RunAct_Uninstalling_old_Key_Exp">
Удаляю старый ключ (Экспериментальный)
</sys:String>
<sys:String x:Key="RunInstall_Installing_Key">
Устанавливаю ключ
</sys:String>
<sys:String x:Key="RunAct_Installing_Key">
Устанавливаю ключ
</sys:String>
<sys:String x:Key="RunAct_Getting_edition_code_Exp">
Получаю код версии (Экспериментальный)
</sys:String>
<sys:String x:Key="RunAct_Prepare_for_the_next_step_Exp">
Подготовка к следующему шагу (Экспериментальный)
</sys:String>
<sys:String x:Key="RunAct_Writing_old_OS">
Записываю возможности старой версии системы
</sys:String>
<sys:String x:Key="RunAct_Getting_free_upgrade_permissions">
Получаю разрешения на бесплатное обновление
</sys:String>
<sys:String x:Key="RunAct_Cleaning_changes">
Очищаю изменения
</sys:String>
<sys:String x:Key="RunAct_Getting_digital_license">
Получаю цифровую лицензию
</sys:String>
<sys:String x:Key="RunUpgradeFullVersion_Upgrading">
Обновляю
</sys:String>
<sys:String x:Key="CompleteTitle">
Готово
</sys:String>
<sys:String x:Key="ErrorTitle">
Ошибка
</sys:String>
<sys:String x:Key="ErrorCode">
Код:
</sys:String>
<sys:String x:Key="SysMsg">
Сообщение системы:
</sys:String>
<!--
Attention:
DO NOT USE ANY Indentation in Preserve Mode, Please!
-->
<sys:String x:Key="UpgradeFullVersionWindowsText" xml:space="preserve">
Вы используете базовую версию Windows, Вы можете использовать эту функцию, чтобы перейти на полную версию. (Если программа не отвечает, Ваша версия системы может не поддерживать переход на полную версию или уже в процессе перехода) Note: Данное действие необратимо. После перехода на полную версию Вы не сможете перейти обратно! Вы хотите продолжить?
</sys:String>
<sys:String x:Key="HelpText" xml:space="preserve">
Эта программа теперь поддерживает аргументы командной строки при запуске! -a	--auto		Автоматическая активация. -h	--hide		Запустить в скрытом режиме (Работает только с --auto). -e	--expact		Экспериментальная активация. -l	--log		Вывод логов в файл. -?	--help		Показать эту справку.
</sys:String>
<sys:String x:Key="DonateTextConverted" xml:space="preserve">
Поздравляю! Windows была успешно конвертирована.
</sys:String>
<sys:String x:Key="DonateTextActivated" xml:space="preserve">
Поздравляю! Windows была успешно активирована.
</sys:String>
<sys:String x:Key="UpdateText" xml:space="preserve">
Была найдена новая версия CloudMoe Windows 10+ Activation Toolkit Digital Edition. Пожалуйста, обновите программу для полной поддержки.
</sys:String>
<sys:String x:Key="UpdateMustText" xml:space="preserve">
Было найдено обязательное обновление CloudMoe Windows 10+ Activation Toolkit Digital Edition. Программа не будет работать без этого обновления.
</sys:String>
<sys:String x:Key="ErrorMsg-0" xml:space="preserve">
При активации Windows требуется подключение к сети (для получения ключа) :)
</sys:String>
<sys:String x:Key="ErrorMsg-1" xml:space="preserve">
Не удалось удалить старый ключ. :(
</sys:String>
<sys:String x:Key="ErrorMsg-1.1" xml:space="preserve">
Не удалось установить ключ. Может, вы выбрали или ввели неправильную версию системы?
</sys:String>
<sys:String x:Key="ErrorMsg-1.2" xml:space="preserve">
Не удалось получить код версии. :(
</sys:String>
<sys:String x:Key="ErrorMsg-2" xml:space="preserve">
Не удалось установить ключ. Может, вы выбрали или ввели неправильную версию системы?
</sys:String>
<sys:String x:Key="ErrorMsg-3" xml:space="preserve">
Превышено время. Может, вы выбрали или ввели неправильную версию системы?
</sys:String>
<sys:String x:Key="ErrorMsg-4" xml:space="preserve">
Активация не выполнена. :( Возможно: 1.Эта версия Windows не поддерживает активацию цифровым ключом. 2. Невозможно подключиться к серверу активации Microsoft Activation Server. 3. Другие неизвестные ошибки. Вы можете попробовать еще раз позже.
</sys:String>
<sys:String x:Key="Only_find_ltok" xml:space="preserve">
Найдены только Long-Term Offline KMS (LTOK) варианты, которые можно использовать с текущей версией системы. Это значит, что при переустановке системы, Вам надо будет активировать ее заново. Не волнуйтесь, это не вариант активации legacy KMS, который может продолжать активироваться в течение 180 дней в оффлайн режиме. LTOK (Префикс Offline-KMS) может продолжать активироваться до 2038 года даже без подключения к сети!
</sys:String>
<sys:String x:Key="DonateTextWillActivated" xml:space="preserve">
Поздравляю! Windows готова к активации. Но похоже, что Windows не может подключиться к серверу активации Microsoft Activation Server. Ваша система будет активирована автоматически при следующем подключении к Microsoft Activation Server.
</sys:String>
</ResourceDictionary>
================================================
FILE: CMWTAT_DIGITAL/Lang/zh.xaml
================================================
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sys="clr-namespace:System;assembly=mscorlib">
<!--
Version: 2.6.0.0
-->
<!--FontFamily Dictionary-->
<FontFamily x:Key="Font">
Microsoft YaHei UI
</FontFamily>
<!--String Dictionary-->
<sys:String x:Key="OK">
好
</sys:String>
<sys:String x:Key="Cancel">
取消
</sys:String>
<sys:String x:Key="Refuse">
丑拒
</sys:String>
<sys:String x:Key="DonateBtn">
请顿晚饭,感谢作者
</sys:String>
<sys:String x:Key="Exit">
退出
</sys:String>
<sys:String x:Key="UpdateNow">
立即更新
</sys:String>
<sys:String x:Key="Ignore">
忽略
</sys:String>
<sys:String x:Key="TitleName">
云萌 Windows 10+ 数字权利激活工具
</sys:String>
<sys:String x:Key="AppName">
CMWTAT Digital Edition V2
</sys:String>
<sys:String x:Key="UpdateTitle">
新版本可用!
</sys:String>
<sys:String x:Key="UpgradeFullVersionWindowsTitle">
升级到完整版 Windows
</sys:String>
<sys:String x:Key="CurrentVersion">
当前版本
</sys:String>
<sys:String x:Key="LatestVersion">
最新版本
</sys:String>
<sys:String x:Key="Auto_Mode">
自动模式
</sys:String>
<sys:String x:Key="Manual_Mode">
手动模式
</sys:String>
<sys:String x:Key="Activate_Button">
激活
</sys:String>
<sys:String x:Key="Convert_versions">
版本无缝转换 (安装产品密钥而不激活)
</sys:String>
<sys:String x:Key="Upgrade_full_version">
升级到完整版 Windows
</sys:String>
<sys:String x:Key="test">
测试文本
</sys:String>
<sys:String x:Key="Loading">
载入中
</sys:String>
<sys:String x:Key="Activating">
激活中
</sys:String>
<sys:String x:Key="Complete">
完成
</sys:String>
<sys:String x:Key="notifyIconTitle">
云萌 Windows 10+ 激活工具 V2
</sys:String>
<sys:String x:Key="Running">
运行中。
</sys:String>
<sys:String x:Key="Experimental">
实验性
</sys:String>
<sys:String x:Key="Attention">
注意
</sys:String>
<sys:String x:Key="System_Edition">
系统版本
</sys:String>
<sys:String x:Key="May_be_not_be_supported">
无法在支持列表里识别您的操作系统版本,可能不受支持。
</sys:String>
<sys:String x:Key="Only_find_experimental">
只找到用于此版本系统的实验性选项,成功概率极低。
</sys:String>
<sys:String x:Key="notify_May_be_not_be_supported_try">
你的系统版本可能不受支持,程序即将退出。不过你可以尝试添加 --expact 或者 -e 参数来启动。
</sys:String>
<sys:String x:Key="notify_May_be_not_be_supported_exit">
你的系统版本可能不受支持,程序即将退出。
</sys:String>
<sys:String x:Key="notify_Disconnect_to_server_exit">
无法连接服务器,请检查网络并尝试稍后重试,程序即将退出。
</sys:String>
<sys:String x:Key="Disconnect_to_server_exit">
无法连接服务器,请检查网络并尝试稍后重试,程序即将退出。
</sys:String>
<sys:String x:Key="RunInstall_Converting">
转换中
</sys:String>
<sys:String x:Key="RunAct_Activating">
激活中
</sys:String>
<sys:String x:Key="RunInstall_Getting_Key">
正在通过网络获取产品密钥
</sys:String>
<sys:String x:Key="RunAct_Getting_Key">
正在通过网络获取产品密钥
</sys:String>
<sys:String x:Key="RunInstall_Uninstalling_old_Key">
正在卸载旧的产品密钥
</sys:String>
<sys:String x:Key="RunAct_Uninstalling_old_Key">
正在卸载旧的产品密钥
</sys:String>
<sys:String x:Key="RunAct_Uninstalling_old_Key_Exp">
正在卸载旧的产品密钥(实验性)
</sys:String>
<sys:String x:Key="RunInstall_Installing_Key">
正在安装产品密钥
</sys:String>
<sys:String x:Key="RunAct_Installing_Key">
正在安装产品密钥
</sys:String>
<sys:String x:Key="RunAct_Getting_edition_code_Exp">
正在获取版本代号(实验性)
</sys:String>
<sys:String x:Key="RunAct_Prepare_for_the_next_step_Exp">
正在准备下一步(实验性)
</sys:String>
<sys:String x:Key="RunAct_Writing_old_OS">
正在写入旧系统残留特征
</sys:String>
<sys:String x:Key="RunAct_Getting_free_upgrade_permissions">
正在获取免费升级许可
</sys:String>
<sys:String x:Key="RunAct_Cleaning_changes">
正在清理更改
</sys:String>
<sys:String x:Key="RunAct_Getting_digital_license">
正在获取数字许可证
</sys:String>
<sys:String x:Key="RunUpgradeFullVersion_Upgrading">
正在升级
</sys:String>
<sys:String x:Key="CompleteTitle">
完成
</sys:String>
<sys:String x:Key="ErrorTitle">
错误
</sys:String>
<sys:String x:Key="ErrorCode">
代码:
</sys:String>
<sys:String x:Key="SysMsg">
系统返回:
</sys:String>
<!--
Attention:
DO NOT USE ANY Indentation in Preserve Mode, Please!
-->
<sys:String x:Key="UpgradeFullVersionWindowsText" xml:space="preserve">
当前正在使用核心版 Windows,你可以通过此功能升级到完整版 Windows。 (如果操作没有反应可能是当前版本不支持升级,或者正在升级) 注意: 此操作不可逆,一旦升级完成将无法回退到核心版 Windows! 确定要执行升级操作吗?
</sys:String>
<sys:String x:Key="HelpText" xml:space="preserve">
这个应用现已支持通过控制台参数启动! -a	--auto		自动激活。 -h	--hide		隐藏模式运行 (只能与 -auto 一起使用)。 -e	--expact	实验性激活。 -l	--log		输出日志到文件。 -?	--help		显示此说明对话框。
</sys:String>
<sys:String x:Key="DonateTextConverted" xml:space="preserve">
祝贺! Windows 已经成功转换。
</sys:String>
<sys:String x:Key="DonateTextActivated" xml:space="preserve">
祝贺! Windows 已经成功激活。
</sys:String>
<sys:String x:Key="UpdateText" xml:space="preserve">
我们发现了新版本的 云萌 Windows 10+ 数字权利激活工具。 请更新到最新版本来确保它可以正常工作。
</sys:String>
<sys:String x:Key="UpdateMustText" xml:space="preserve">
我们发现了新版本的 云萌 Windows 10+ 数字权利激活工具。 由于您的版本太旧,所以您必须更新到最新版本来确保它可以正常工作。
</sys:String>
<sys:String x:Key="ErrorMsg-0" xml:space="preserve">
激活 Windows 需要网络获取产品密钥 :)
</sys:String>
<sys:String x:Key="ErrorMsg-1" xml:space="preserve">
无法卸载旧密钥 :(
</sys:String>
<sys:String x:Key="ErrorMsg-1.1" xml:space="preserve">
无法安装密钥,可能没有选择或输入正确的版本 :(
</sys:String>
<sys:String x:Key="ErrorMsg-1.2" xml:space="preserve">
无法获取版本代号 :(
</sys:String>
<sys:String x:Key="ErrorMsg-2" xml:space="preserve">
无法安装密钥,可能没有选择或输入正确的版本 :(
</sys:String>
<sys:String x:Key="ErrorMsg-3" xml:space="preserve">
执行超时,可能没有选择正确或输入的版本 :(
</sys:String>
<sys:String x:Key="ErrorMsg-4" xml:space="preserve">
激活失败。 :( 可能因为: 1. 此版本/类型的 Windows 不支持数字权利(数字许可证)方式激活。 2. 无法连接到微软Windows激活服务器。 3. 其它未知问题。 你可以尝试稍等片刻或者稍后重试。
</sys:String>
<sys:String x:Key="Only_find_ltok" xml:space="preserve">
只找到用于此版本系统的长期离线KMS(批量激活)选项。 这表示您将不能在下次重装系统后自动激活。 不过无需担心,这不同于传统的KMS激活方式(离线状态下可以保持激活180天) 长期离线KMS(Offline-KMS)即使不联网也可以保持激活值2038年!
</sys:String>
<sys:String x:Key="DonateTextWillActivated" xml:space="preserve">
祝贺! Windows 已经快要激活成功了。 不过似乎Windows无法连接到微软激活服务器, 当下次连接上服务器时系统将会自动激活。
</sys:String>
</ResourceDictionary>
================================================
FILE: CMWTAT_DIGITAL/MainWindow.xaml
================================================
<Window x:Class="CMWTAT_DIGITAL.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"
xmlns:domain="clr-namespace:CMWTAT_DIGITAL.Domain"
xmlns:local="clr-namespace:CMWTAT_DIGITAL"
mc:Ignorable="d"
Title="{DynamicResource TitleName}" Height="645" Width="450"
ResizeMode="NoResize"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
TextElement.FontWeight="Regular"
TextElement.FontSize="13"
TextOptions.TextFormattingMode="Ideal"
TextOptions.TextRenderingMode="Aliased"
Background="{DynamicResource MaterialDesignPaper}"
d:DataContext="{d:DesignInstance domain:ViewModel, d:IsDesignTimeCreatable=False}"
Icon="CMWTAT.ico"
Closing="Window_Closing"
FontFamily="{DynamicResource Font}"
Activated="Window_Activated"
WindowStartupLocation="CenterScreen"
Loaded="Window_Loaded"
>
<!--FontFamily="{DynamicResource MaterialDesignFont}"-->
<Grid>
<Grid Margin="30,30,30,30" VerticalAlignment="Center">
<StackPanel>
<materialDesign:Card Padding="30" Margin="0,0,0,0" materialDesign:ShadowAssist.ShadowDepth="Depth3" UniformCornerRadius="8">
<TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignHeadline6TextBlock}" ><Run Text="{DynamicResource AppName}"/></TextBlock>
</materialDesign:Card>
<materialDesign:Card Padding="30,30" Margin="0,30,0,0" materialDesign:ShadowAssist.ShadowDepth="Depth3" UniformCornerRadius="8">
<StackPanel>
<Grid>
<ComboBox x:Name="SystemEditionText" DisplayMemberPath="DisplayOS" VerticalAlignment="Center" Visibility="Visible"/>
<TextBox x:Name="SystemEditionTextInput" materialDesign:HintAssist.Hint="XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" MaxLength="29" xmlns:input="clr-namespace:System.Windows.Input;assembly=PresentationCore" input:InputMethod.IsInputMethodEnabled="False" VerticalAlignment="Center" Visibility="Hidden" TextChanged="SystemEditionTextInput_TextChanged">
<TextBox.Text>
<Binding Path="SN" UpdateSourceTrigger="PropertyChanged">
<Binding.ValidationRules>
<domain:IsSN ValidatesOnTargetUpdated="True"/>
</Binding.ValidationRules>
</Binding>
</TextBox.Text>
</TextBox>
</Grid>
<!--<TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignTitleTextBlock}" x:Name="SystemEditionText" Text="Checking System" />-->
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal" Margin="0,30,0,0">
<RadioButton x:Name="AutoRadio" Content="{DynamicResource Auto_Mode}" Margin="30,0,30,0" IsChecked="True" Checked="A_RadioButton_Checked"/>
<RadioButton x:Name="ManualRadio" Content="{DynamicResource Manual_Mode}" Margin="30,0,30,0" Checked="M_RadioButton_Checked"/>
</StackPanel>
</StackPanel>
</materialDesign:Card>
<Button FontFamily="{DynamicResource Font}" x:Name="actbtn" Click="Activate_Button_Click" Content="{DynamicResource Activate_Button}" materialDesign:ShadowAssist.ShadowDepth="Depth3" materialDesign:ShadowAssist.Darken="False" materialDesign:ButtonAssist.CornerRadius="8" Margin="0,30,0,0" Height="65" Cursor="Hand" />
<Button FontFamily="{DynamicResource Font}" x:Name="installbtn" Click="installbtn_Click" Content="{DynamicResource Convert_versions}" materialDesign:ShadowAssist.ShadowDepth="Depth3" materialDesign:ShadowAssist.Darken="False" materialDesign:ButtonAssist.CornerRadius="8" Margin="0,30,0,0" Height="65" Cursor="Hand"/>
<Button FontFamily="{DynamicResource Font}" x:Name="upgradefullbtn" Click="upgradefullbtn_Click" Content="{DynamicResource Upgrade_full_version}" materialDesign:ShadowAssist.ShadowDepth="Depth3" materialDesign:ShadowAssist.Darken="False" materialDesign:ButtonAssist.CornerRadius="8" Margin="0,30,0,0" Height="65" Cursor="Hand"/>
</StackPanel>
</Grid>
<Grid x:Name="DialogHostGrid" Visibility="Hidden">
<materialDesign:DialogHost x:Name="DialogWait" IsOpen="False">
<materialDesign:DialogHost.DialogContent>
<Grid>
<materialDesign:Card UniformCornerRadius="8" materialDesign:ShadowAssist.ShadowDepth="Depth3">
<StackPanel>
<StackPanel Margin="32,24,32,24">
<ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />
<TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignHeadline6TextBlock}" Margin="0,24,0,0" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="14" Text="{DynamicResource Loading}" />
</StackPanel>
</StackPanel>
</materialDesign:Card>
</Grid>
</materialDesign:DialogHost.DialogContent>
</materialDesign:DialogHost>
<materialDesign:DialogHost x:Name="DialogActProg" IsOpen="False">
<materialDesign:DialogHost.DialogContent>
<Grid>
<materialDesign:Card UniformCornerRadius="8" materialDesign:ShadowAssist.ShadowDepth="Depth3">
<StackPanel>
<StackPanel Margin="32,24,32,24">
<ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />
<TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignHeadline6TextBlock}" x:Name="activatingtext" Margin="0,24,0,0" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="14" Text="{DynamicResource Activating}" />
</StackPanel>
</StackPanel>
</materialDesign:Card>
</Grid>
</materialDesign:DialogHost.DialogContent>
</materialDesign:DialogHost>
<materialDesign:DialogHost x:Name="DialogWithCancel" IsOpen="False">
<materialDesign:DialogHost.DialogContent>
<Grid>
<materialDesign:Card UniformCornerRadius="8" materialDesign:ShadowAssist.ShadowDepth="Depth3">
<StackPanel>
<StackPanel Margin="24,24,24,8">
<ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />
<TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignHeadline6TextBlock}" Margin="24,16,24,0" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="14" Text="{DynamicResource Loading}" />
</StackPanel>
<StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal" Margin="8,0,8,8">
<Button FontFamily="{DynamicResource Font}" Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}"
CommandParameter="Sample2Cancel"
HorizontalAlignment="Center" Content="{DynamicResource Cancel}" />
</StackPanel>
</StackPanel>
</materialDesign:Card>
</Grid>
</materialDesign:DialogHost.DialogContent>
</materialDesign:DialogHost>
<materialDesign:DialogHost x:Name="DialogWithOK" IsOpen="False">
<materialDesign:DialogHost.DialogContent>
<Grid>
<materialDesign:Card UniformCornerRadius="8" materialDesign:ShadowAssist.ShadowDepth="Depth3">
<StackPanel>
<StackPanel Margin="16,16,16,8">
<!--<ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />-->
<TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignHeadline6TextBlock}" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" FontWeight="Bold" Text="Title" />
<TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignHeadline6TextBlock}" Margin="0,8,0,0" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="14" Text="Hello World" />
</StackPanel>
<StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal" Margin="8,0,8,8">
<Button FontFamily="{DynamicResource Font}" Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}"
CommandParameter="Sample2Cancel"
HorizontalAlignment="Center" Content="{DynamicResource OK}" />
</StackPanel>
</StackPanel>
</materialDesign:Card>
</Grid>
</materialDesign:DialogHost.DialogContent>
</materialDesign:DialogHost>
<materialDesign:DialogHost x:Name="DialogHelp" IsOpen="False">
<materialDesign:DialogHost.DialogContent>
<Grid>
<materialDesign:Card UniformCornerRadius="8" materialDesign:ShadowAssist.ShadowDepth="Depth3">
<StackPanel>
<StackPanel Margin="16,16,16,8">
<!--<ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />-->
<TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignHeadline6TextBlock}" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" FontWeight="Bold" Text="Help"></TextBlock>
<TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignHeadline6TextBlock}" Margin="0,8,0,0" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="14" Text="{DynamicResource HelpText}"></TextBlock>
</StackPanel>
<StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal" Margin="8,0,8,8">
<Button FontFamily="{DynamicResource Font}" Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}"
CommandParameter="Sample2Cancel"
HorizontalAlignment="Center" Content="{DynamicResource OK}" />
</StackPanel>
</StackPanel>
</materialDesign:Card>
</Grid>
</materialDesign:DialogHost.DialogContent>
</materialDesign:DialogHost>
<materialDesign:DialogHost x:Name="DialogWithExit" IsOpen="False">
<materialDesign:DialogHost.DialogContent>
<Grid>
<materialDesign:Card UniformCornerRadius="8" materialDesign:ShadowAssist.ShadowDepth="Depth3">
<StackPanel>
<StackPanel Margin="16,16,16,8">
<!--<ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />-->
<TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignHeadline6TextBlock}" x:Name="DialogWithExitTitle" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" FontWeight="Bold" Text="{DynamicResource ErrorTitle}"/>
<TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignHeadline6TextBlock}" x:Name="DialogWithExitText" Margin="0,8,0,0" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="14" Text="{DynamicResource Disconnect_to_server_exit}"/>
</StackPanel>
<StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal" Margin="8,0,8,8">
<Button FontFamily="{DynamicResource Font}" Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
Click="Exit_Button_Click"
HorizontalAlignment="Center" Content="{DynamicResource Exit}"/>
</StackPanel>
</StackPanel>
</materialDesign:Card>
</Grid>
</materialDesign:DialogHost.DialogContent>
</materialDesign:DialogHost>
<materialDesign:DialogHost x:Name="DialogWithOKToCloseDialog" IsOpen="False">
<materialDesign:DialogHost.DialogContent>
<Grid>
<materialDesign:Card UniformCornerRadius="8" materialDesign:ShadowAssist.ShadowDepth="Depth3">
<StackPanel>
<StackPanel Margin="16,16,16,8">
<!--<ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />-->
<TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignHeadline6TextBlock}" x:Name="DialogWithOKToCloseDialogTitle" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" FontWeight="Bold" >Title</TextBlock>
<TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignHeadline6TextBlock}" x:Name="DialogWithOKToCloseDialogText" Margin="0,8,0,0" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="14" >Text</TextBlock>
</StackPanel>
<StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal" Margin="8,0,8,8">
<Button FontFamily="{DynamicResource Font}" Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}"
HorizontalAlignment="Center" Content="{DynamicResource OK}"/>
</StackPanel>
</StackPanel>
</materialDesign:Card>
</Grid>
</materialDesign:DialogHost.DialogContent>
</materialDesign:DialogHost>
<materialDesign:DialogHost x:Name="DialogWithOKToCloseDialogDonate" IsOpen="False">
<materialDesign:DialogHost.DialogContent>
<Grid>
<materialDesign:Card UniformCornerRadius="8" materialDesign:ShadowAssist.ShadowDepth="Depth3">
<StackPanel>
<StackPanel Margin="16,16,16,8">
<!--<ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />-->
<TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignHeadline6TextBlock}" x:Name="DialogWithOKToCloseDialogDonateTitle" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" FontWeight="Bold" Text="{DynamicResource Complete}" />
<TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignHeadline6TextBlock}" x:Name="DialogWithOKToCloseDialogDonateText" Margin="0,8,0,0" HorizontalAlignment="Left" VerticalAlignment="Bottom" FontSize="14" Text="{DynamicResource DonateTextActivated}" />
</StackPanel>
<StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal" Margin="8,0,8,8">
<Button FontFamily="{DynamicResource Font}" Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}" HorizontalAlignment="Center" Content="{DynamicResource Refuse}"/>
<Button FontFamily="{DynamicResource Font}" Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
Click="Donate_Button_Click" HorizontalAlignment="Center" Content="{DynamicResource DonateBtn}"/>
</StackPanel>
</StackPanel>
</materialDesign:Card>
</Grid>
</materialDesign:DialogHost.DialogContent>
</materialDesign:DialogHost>
<materialDesign:DialogHost x:Name="DialogUpdate" IsOpen="False">
<materialDesign:DialogHost.DialogContent>
<Grid>
<materialDesign:Card UniformCornerRadius="8" materialDesign:ShadowAssist.ShadowDepth="Depth3">
<StackPanel>
<StackPanel Margin="16,16,16,8">
<!--<ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />-->
<TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignHeadline6TextBlock}" x:Name="DialogUpdateTitle" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" FontWeight="Bold" Text="{DynamicResource UpdateTitle}" />
<TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignHeadline6TextBlock}" x:Name="DialogUpdateText" Margin="0,8,0,0" HorizontalAlignment="Left" VerticalAlignment="Bottom" FontSize="14" Text="{DynamicResource UpdateText}" />
</StackPanel>
<StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal" Margin="8,0,8,8">
<Button x:Name="IgnoreUpdate" FontFamily="{DynamicResource Font}" Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}" HorizontalAlignment="Center" Content="{DynamicResource Ignore}"/>
<Button x:Name="UpdateBtn" FontFamily="{DynamicResource Font}" Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
Click="UpdateBtn_Click" HorizontalAlignment="Center" Content="{DynamicResource UpdateNow}"/>
</StackPanel>
</StackPanel>
</materialDesign:Card>
</Grid>
</materialDesign:DialogHost.DialogContent>
</materialDesign:DialogHost>
<materialDesign:DialogHost x:Name="DialogUpgradeFullVersion" IsOpen="False">
<materialDesign:DialogHost.DialogContent>
<Grid>
<materialDesign:Card UniformCornerRadius="8" materialDesign:ShadowAssist.ShadowDepth="Depth3">
<StackPanel>
<StackPanel Margin="16,16,16,8">
<!--<ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />-->
<TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignTitleTextBlock}" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" FontWeight="Bold" Text="{DynamicResource UpgradeFullVersionWindowsTitle}" />
<TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignTitleTextBlock}" Margin="0,8,0,0" HorizontalAlignment="Left" VerticalAlignment="Bottom" FontSize="14" Text="{DynamicResource UpgradeFullVersionWindowsText}" />
</StackPanel>
<StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal" Margin="8,0,8,8">
<Button FontFamily="{DynamicResource Font}" Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}" HorizontalAlignment="Center" Content="{DynamicResource Cancel}"/>
<Button FontFamily="{DynamicResource Font}" Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
Click="UpgradeFullVersionWindows_Click" HorizontalAlignment="Center" Content="{DynamicResource OK}"/>
</StackPanel>
</StackPanel>
</materialDesign:Card>
</Grid>
</materialDesign:DialogHost.DialogContent>
</materialDesign:DialogHost>
</Grid>
</Grid>
</Window>
================================================
FILE: CMWTAT_DIGITAL/MainWindow.xaml.cs
================================================
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Net;
using System.IO;
using System.Threading;
using Microsoft.Win32;
using System.Text.RegularExpressions;
using System.Globalization;
using System.Reflection;
using System.Windows.Forms;
using OSVersionInfoClass;
using Newtonsoft.Json.Linq;
using MaterialDesignThemes.Wpf;
namespace CMWTAT_DIGITAL
{
static class Constants
{
public const string DefaultLang = "en"; // 缺省语言
}
/// <summary>
/// MainWindow.xaml 的交互逻辑
/// </summary>
public partial class MainWindow : Window
{
[DllImport("Kernel32.dll")]
private static extern bool Wow64EnableWow64FsRedirection(bool Wow64FsEnableRedirection);//重定向
public struct Frequency
{
public int ID { get; set; }
public string DisplayOS { get; set; }
}
public static void ConsoleLog(string log_text = "")
{
Console.WriteLine(log_text);
if (App.log2file == true)
{
WriteLog(log_text);
}
}
public static void WriteLog(string strLog)
{
string sFilePath = AppDomain.CurrentDomain.BaseDirectory;
string sFileName = "CMWTAT-" + DateTime.Now.ToString("yyyy-MM-dd") + ".log";
sFileName = sFilePath + sFileName; //文件的绝对路径
if (!Directory.Exists(sFilePath))//验证路径是否存在
{
Directory.CreateDirectory(sFilePath);
//不存在则创建
}
FileStream fs;
StreamWriter sw;
if (File.Exists(sFileName))
//验证文件是否存在,有则追加,无则创建
{
fs = new FileStream(sFileName, FileMode.Append, FileAccess.Write);
}
else
{
fs = new FileStream(sFileName, FileMode.Create, FileAccess.Write);
}
sw = new StreamWriter(fs);
sw.WriteLine(DateTime.Now.ToString("yyyy-MM-dd HH-mm-ss") + " --- " + strLog);
sw.Close();
fs.Close();
}
string tempfile = Path.GetTempPath() + @"CMWTAT_DIGITAL\";
public void DelectTempFile()
{
if (Directory.Exists(tempfile))
{
try
{
FileAttributes attr = File.GetAttributes(tempfile);
if (attr == FileAttributes.Directory)
{
Directory.Delete(tempfile, true);
}
else
{
File.Delete(tempfile);
}
}
catch (Exception e)
{
ConsoleLog("DelectTempFile:" + e.Message);
}
}
}
public void ExportTempFile()
{
if (Directory.Exists(tempfile))
{
ConsoleLog("找到已存在的缓存,开始删除");
DelectTempFile();
ConsoleLog("删除操作完毕");
if (Directory.Exists(tempfile))
{
ConsoleLog("[警告] 检测到文件依旧存在");
}
}
ConsoleLog("开始创建缓存目录");
if (Directory.Exists(tempfile) == false)
{
Directory.CreateDirectory(tempfile);
}
ConsoleLog("创建缓存目录完毕");
ConsoleLog("开始写入缓存文件");
File.WriteAllBytes(tempfile + "ClipUp" + ".exe", Properties.Resources.ClipUp);
File.WriteAllBytes(tempfile + "slmgr" + ".vbs", Properties.Resources.slmgr);
ConsoleLog("写入缓存文件完毕");
}
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;
/// <summary>
/// 加载指定语言(支持热加载)
/// </summary>
public void LoadLang(string LangName = Constants.DefaultLang)
{
//MessageBox.Show(currentCultureInfo.Name);
try
{
//根据名字载入语言文件
langRd = System.Windows.Application.LoadComponent(new Uri(@"/CMWTAT_DIGITAL;component/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(@"/CMWTAT_DIGITAL;component/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);
}
}
private static void ApplyBase(bool isDark)
{
var theme = new PaletteHelper().GetTheme();
theme.SetBaseTheme(isDark ? Theme.Dark : Theme.Light);
new PaletteHelper().SetTheme(theme);
}
string ProductVersion = "0.0.0.0"; // 存储程序版本
/// <summary>
/// 获取当前版本
/// </summary>
private void GetEdition()
{
Assembly assembly = Assembly.GetExecutingAssembly();
ConsoleLog("AppAssemblyFullName: " + assembly.FullName);
// 获取程序集元数据
AssemblyCopyrightAttribute copyright = (AssemblyCopyrightAttribute)
Attribute.GetCustomAttribute(assembly, typeof(AssemblyCopyrightAttribute));
AssemblyDescriptionAttribute description = (AssemblyDescriptionAttribute)
Attribute.GetCustomAttribute(assembly, typeof(AssemblyDescriptionAttribute));
ProductVersion = assembly.GetName().Version.ToString();
ConsoleLog("AppDescription: " + description.Description);
ConsoleLog("AppCopyright: " + copyright.Copyright);
ConsoleLog("AppProductVersion: " + ProductVersion);
}
public string SystemEdition = OSVersionInfo.Edition;
bool isDark = false;
string WindowsTheme = "Light";
NotifyIcon notifyIcon;
public void CheckWindowsTheme()
{
var uiSettings = new Windows.UI.ViewManagement.UISettings();
Windows.UI.Color Wcolor = uiSettings.GetColorValue(Windows.UI.ViewManagement.UIColorType.Background);
System.Drawing.Color Scolor = System.Drawing.Color.FromArgb(Wcolor.R, Wcolor.G, Wcolor.B);
float hue = Scolor.GetHue(); // 色调
float saturation = Scolor.GetSaturation(); // 饱和度
float lightness = Scolor.GetBrightness(); // 亮度
if (lightness > 0.75)
{
isDark = false;
WindowsTheme = "Light";
}
else
{
isDark = true;
WindowsTheme = "Dark";
}
//ConsoleLog("Windows Theme Background is: " + Wcolor);
//ConsoleLog("Windows Theme Brightness is: " + lightness);
//ConsoleLog("Windows Theme Mode is: " + WindowsTheme);
}
public MainWindow()
{
InitializeComponent();
}
JArray ositems;
int now_os_index = 0;
string checked_os = "unknow";
bool is_auto = true; //是否为自动模式,false为手动
/// <summary>
/// 检查更新
/// </summary>
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<Frequency> check_update_list = new List<Frequency>();
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 StaticServerDomain = "https://uwa-static.cloudmoe.com"; // 静态服务器
public static string MainServerDomain = "https://cmwtat.cloudmoe.com"; // 主要服务器
public static string BackupServerDomain = "https://kms.kumo.moe"; // 备用服务器
private void LoadOSList()
{
int is_selected = 0; //是否已经自动选择,0未选择,1普通模式,2实验模式,3离线KMS模式
actbtn.Dispatcher.Invoke(new Action(() =>
{
DialogWait.IsOpen = true;
}));
try
{
string json;
try
{
json = GetHttpWebRequest(MainServerDomain + "/api/digital?list=1&ver=4"); // 主要服务器
}
catch (Exception e)
{
ConsoleLog("MainServer:" + MainServerDomain + " is not working.");
ConsoleLog("Error Message:" + e.Message);
ConsoleLog("Ready to use BackupServer:" + BackupServerDomain);
json = GetHttpWebRequest(BackupServerDomain + "/api/digital?list=1&ver=4"); // 备用服务器
}
JObject jsonobj = JObject.Parse(json);
List<Frequency> list = new List<Frequency>();
Frequency freq = new Frequency();
ositems = (JArray)jsonobj["OS"];
for (int i = 0; i < ositems.Count(); i++)
{
freq.ID = i;
freq.DisplayOS = jsonobj["OS"][i].ToString();
//按照优先级判断,如果已经自动选择则忽略新的
//选择带版本号
if (String.Equals(jsonobj["OS"][i].ToString(), SystemEdition + OSVersionInfo.BuildVersion, StringComparison.CurrentCultureIgnoreCase) && is_selected == 0)//jsonobj["OS"][i].ToString() == SystemEdition + OSVersionInfo.BuildVersion
{
now_os_index = i;
checked_os = SystemEdition + OSVersionInfo.BuildVersion;
is_selected = 1;
}
//选择带版本号Offline-KMS
if (String.Equals(jsonobj["OS"][i].ToString(), "(Offline-KMS) " + SystemEdition + OSVersionInfo.BuildVersion, StringComparison.CurrentCultureIgnoreCase) && is_selected == 0)//旧的方法:jsonobj["OS"][i].ToString() == "(Experimental) " + SystemEdition,新方法忽略大小写并提升效率
{
now_os_index = i;
checked_os = "(Offline-KMS) " + SystemEdition + OSVersionInfo.BuildVersion;
is_selected = 3;
}
//选择不带版本号
if (String.Equals(jsonobj["OS"][i].ToString(), SystemEdition, StringComparison.CurrentCultureIgnoreCase) && is_selected == 0)//jsonobj["OS"][i].ToString() == SystemEdition
{
now_os_index = i;
checked_os = SystemEdition;
is_selected = 1;
}
//选择不带版本号Offline-KMS
if (String.Equals(jsonobj["OS"][i].ToString(), "(Offline-KMS) " + SystemEdition, StringComparison.CurrentCultureIgnoreCase) && is_selected == 0)//旧的方法:jsonobj["OS"][i].ToString() == "(Experimental) " + SystemEdition,新方法忽略大小写并提升效率
{
now_os_index = i;
checked_os = "(Offline-KMS) " + SystemEdition;
is_selected = 3;
}
//选择不带版本号实验
if (String.Equals(jsonobj["OS"][i].ToString(), "(Experimental) " + SystemEdition, StringComparison.CurrentCultureIgnoreCase) && is_selected == 0)//旧的方法:jsonobj["OS"][i].ToString() == "(Experimental) " + SystemEdition,新方法忽略大小写并提升效率
{
now_os_index = i;
checked_os = "(Experimental) " + SystemEdition;
is_selected = 2;
}
list.Add(freq);
}
actbtn.Dispatcher.Invoke(new Action(() =>
{
this.SystemEditionText.ItemsSource = list;//控件的ID
if (is_selected == 0)//没有匹配
{
this.SystemEditionText.SelectedIndex = 0;
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 = now_os_index;
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 if (is_selected == 3)//只找到长期KMS
{
this.SystemEditionText.SelectedIndex = now_os_index;
this.DialogWithOKToCloseDialogTitle.Text = (string)this.Resources["Attention"];
this.DialogWithOKToCloseDialogText.Text = (string)this.Resources["Only_find_ltok"] + "\r\n(" + (string)this.Resources["System_Edition"] + ": " + SystemEdition + OSVersionInfo.BuildVersion + ")";
this.DialogWithOKToCloseDialog.IsOpen = true;
}
else
{
this.SystemEditionText.SelectedIndex = now_os_index;
}
}));
//this.SystemEditionText.SelectedIndex = now_os_index;
actbtn.Dispatcher.Invoke(new Action(() =>
{
DialogWait.IsOpen = false;
}));
if (App.autoact == true)//自动激活
{
Thread actthread = new Thread(RunAct);
switch (is_selected)
{
case 1: //正常
actthread.Start();
break;
case 2: //实验性
if (App.expact == true)
{
actbtn.Dispatcher.Invoke(new Action(() =>
{
DialogWithOKToCloseDialog.IsOpen = false;
}));
actthread.Start();
}
else
{
if (App.hiderun == true)
{
int tipShowMilliseconds = 0;
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);//退出
}
}
break;
default:
if (App.hiderun == true)
{
int tipShowMilliseconds = 0;
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);//退出
}
break;
}
}
}
catch
{
actbtn.Dispatcher.Invoke(new Action(() =>
{
DialogWait.IsOpen = false;
}));
actbtn.Dispatcher.Invoke(new Action(() =>
{
DialogWithExit.IsOpen = true;
}));
if (App.hiderun == true && App.autoact == true)
{
int tipShowMilliseconds = 0;
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 CheckWindowsCore()
{
if (SystemEdition.ToLower().IndexOf("core") == -1)
{
upgradefullbtn.IsEnabled = false;
upgradefullbtn.Visibility = Visibility.Collapsed;
this.Height -= 95;
}
}
private void Activate_Button_Click(object sender, RoutedEventArgs e)
{
Thread actthread = new Thread(RunAct);
actthread.Start();
//RunAct();
//LoadOSList();
//MessageBox.Show(json);
//MessageBox.Show(rss["OS"][0].ToString());
//MessageBox.Show(SystemEdition);
}
private void installbtn_Click(object sender, RoutedEventArgs e)
{
Thread installthread = new Thread(RunInstall);
installthread.Start();
}
private void upgradefullbtn_Click(object sender, RoutedEventArgs e)
{
this.DialogUpgradeFullVersion.IsOpen = true;
}
private void UpgradeFullVersionWindows_Click(object sender, RoutedEventArgs e)
{
this.DialogUpgradeFullVersion.IsOpen = false;
Thread upgradethread = new Thread(RunUpgradeFullVersion);
upgradethread.Start();
}
private string GetHttpWebRequest(string url, int timeout = 10000, int retry = 2)
{
string outex = "UnknowError";
for (int i = 0; i < retry; i++) // 默认重试2次
{
ConsoleLog("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;
ConsoleLog("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)
{
DelectTempFile();
notifyIcon.Visible = false;
System.Windows.Application.Current.Shutdown();
}
private void RunInstall()
{
ExportTempFile();
//释放文件
actbtn.Dispatcher.Invoke(new Action(() =>
{
this.DialogActProg.IsOpen = true;
this.activatingtext.Text = (string)this.Resources["RunInstall_Converting"]; //提示转换中
}));
Wow64EnableWow64FsRedirection(false);//关闭文件重定向
string code = "-0";
string key = "00000-00000-00000-00000-00000";
string sku = "0";
string msg = "Unknow Error!";
string system = "";
string slmgr = Environment.GetFolderPath(Environment.SpecialFolder.SystemX86) + "\\slmgr.vbs";
string slmgr_self = tempfile + "slmgr.vbs";
try
{
string sourceFile = slmgr;
string targetFile = slmgr_self;
bool isrewrite = true; // true=覆盖已存在的同名文件,false则反之
ConsoleLog("Copy Start: " + sourceFile + " To " + targetFile);
System.IO.File.Copy(sourceFile, targetFile, isrewrite);
ConsoleLog("Copy Completed.");
}
catch (Exception CopyExc)
{
ConsoleLog("Copy has Exception: " + CopyExc.Message);
}
//旧的位置
//string slmgr_self = System.AppDomain.CurrentDomain.BaseDirectory + "slmgr.vbs";
string changepk = Environment.SystemDirectory + "\\changepk.exe";
if (is_auto == true)
{
actbtn.Dispatcher.Invoke(new Action(() =>
{
system = this.SystemEditionText.Text;
}));
actbtn.Dispatcher.Invoke(new Action(() =>
{
this.activatingtext.Text = (string)this.Resources["RunInstall_Getting_Key"]; //提示正在获取密钥
}));
//获取密钥和SKU
try
{
string json;
try
{
json = GetHttpWebRequest(MainServerDomain + "/api/digital?list=0&ver=4"); // 主要服务器
}
catch (Exception e)
{
ConsoleLog("MainServer:" + MainServerDomain + " is not working.");
ConsoleLog("Error Message:" + e.Message);
ConsoleLog("Ready to use BackupServer:" + BackupServerDomain);
json = GetHttpWebRequest(BackupServerDomain + "/api/digital?list=0&ver=4"); // 备用服务器
}
JObject jsonobj = JObject.Parse(json);
List<Frequency> list = new List<Frequency>();
ositems = (JArray)jsonobj["OS"];
key = jsonobj[system]["key"].ToString();
sku = jsonobj[system]["sku"].ToString();
ConsoleLog("Edition:" + system + "\r\nKEY:" + key + "\r\nSKU:" + sku);
}
catch
{
code = "-0";
msg = (string)this.Resources["ErrorMsg-0"]; // "激活Windows10需要网络获取产品密钥 :) \nActivate Windows 10 requires a network to gets the product key :)";
goto EndLine;
}
}
else
{
//手动密钥
actbtn.Dispatcher.Invoke(new Action(() =>
{
key = this.SystemEditionTextInput.Text;
}));
}
actbtn.Dispatcher.Invoke(new Action(() =>
{
this.activatingtext.Text = (string)this.Resources["RunInstall_Uninstalling_old_Key"]; //提示正在卸载旧密钥
}));
//卸载
string runend = RunCScript(slmgr_self, "-upk").Trim();
//string runend = RunCMD(@"cscript.exe /nologo %systemroot%\system32\slmgr.vbs -upk").Trim();
ConsoleLog(runend);
if (runend.EndsWith("successfully.") || runend.EndsWith("not found."))
{
actbtn.Dispatcher.Invoke(new Action(() =>
{
this.activatingtext.Text = (string)this.Resources["RunInstall_Installing_Key"]; //提示正在安装密钥
}));
//安装数字权利升级密钥
if (RunCScript(slmgr_self, "-ipk " + key).Trim().EndsWith("successfully."))
//if (RunCMD(@"cscript.exe /nologo %systemroot%\system32\slmgr.vbs -ipk " + key).Trim().EndsWith("successfully."))
{
code = "200";
}
else
{
code = "-2";
msg = (string)this.Resources["ErrorMsg-2"]; // "无法安装密钥,可能没有选择或输入正确的版本 :(\nCannot to install key, may be you choose or enter a incorrect version. :(";
}
}
else
{
code = "-1";
msg = (string)this.Resources["ErrorMsg-1"]; // "无法卸载旧密钥 :(\nCannot to uninstall old key. :(";
}
//string runend = RunCScript(slmgr_self, "-upk").Trim();
EndLine:;
if (code != "200")
{
actbtn.Dispatcher.Invoke(new Action(() =>
{
this.DialogActProg.IsOpen = false;
this.activatingtext.Text = (string)this.Resources["RunInstall_Converting"]; //提示转换中
this.DialogWithOKToCloseDialog.IsOpen = true;
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);
}
else
{
actbtn.Dispatcher.Invoke(new Action(() =>
{
this.DialogActProg.IsOpen = false;
this.activatingtext.Text = (string)this.Resources["RunInstall_Converting"]; //提示转换中
this.DialogWithOKToCloseDialogDonate.IsOpen = true;
this.DialogWithOKToCloseDialogDonateTitle.Text = (string)this.Resources["CompleteTitle"]; //完成标题
this.DialogWithOKToCloseDialogDonateText.Text = (string)this.Resources["DonateTextConverted"]; //完成转换内容
}));
//MessageBox.Show("Congratulation!");
}
DelectTempFile();
//清理文件
}
private void RunUpgradeFullVersion()
{
actbtn.Dispatcher.Invoke(new Action(() =>
{
this.DialogActProg.IsOpen = true;
this.activatingtext.Text = (string)this.Resources["RunUpgradeFullVersion_Upgrading"]; //提示升级中
}));
RunCMD(@"sc start sppsvc");
RunCMD(@"sc start wuauserv");
RunCLI("ChangePK.exe", ".", "/ProductKey VK7JG-NPHTM-C97JM-9MPGT-3V66T"); // Pro
RunCLI("ChangePK.exe", ".", "/ProductKey 2B87N-8KFHP-DKV6R-Y2C8J-PKCKT"); // Pro N
RunCLI("ChangePK.exe", ".", "/ProductKey W269N-WFGWX-YVC9B-4J6C9-T83GX"); // KMS Pro
RunCLI("ChangePK.exe", ".", "/ProductKey MH37W-N47XK-V7XM9-C7227-GCQG9"); // KMS Pro N
actbtn.Dispatcher.Invoke(new Action(() =>
{
this.DialogActProg.IsOpen = false;
}));
}
private void ShowBallSameDig()
{
actbtn.Dispatcher.Invoke(new Action(() =>
{
if (App.hiderun == true && App.autoact == true)
{
int tipShowMilliseconds = 0;
string tipTitle = (string)this.Resources["notifyIconTitle"];
string tipContent = this.activatingtext.Text;
ToolTipIcon tipType = ToolTipIcon.None;
notifyIcon.ShowBalloonTip(tipShowMilliseconds, tipTitle, tipContent, tipType);
}
}));
}
private void RunAct()
{
bool is_not_network_to_act = false; //是否无法联网稍后激活
ExportTempFile();
//释放文件
actbtn.Dispatcher.Invoke(new Action(() =>
{
this.DialogActProg.IsOpen = true;
this.activatingtext.Text = (string)this.Resources["RunAct_Activating"]; //提示激活中
ShowBallSameDig();
}));
Wow64EnableWow64FsRedirection(false);//关闭文件重定向
string code = "-0";
string key = "00000-00000-00000-00000-00000";
string sku = "0";
string msg = "Unknow Error!";
string system = "";
string mode = "1"; //1:普通(SYS、SKU、KEY完全);2.需要获取SKU(SYS、KEY);3.手动输入KEY;4.普通OfflineKMS(SYS、SKU、KEY完全)
string slmgr = Environment.GetFolderPath(Environment.SpecialFolder.SystemX86) + "\\slmgr.vbs";
string slmgr_self = tempfile + "slmgr.vbs";
try
{
string sourceFile = slmgr;
string targetFile = slmgr_self;
bool isrewrite = true; // true=覆盖已存在的同名文件,false则反之
ConsoleLog("Copy Start: " + sourceFile + " To " + targetFile);
File.Copy(sourceFile, targetFile, isrewrite);
ConsoleLog("Copy Completed.");
}
catch (Exception CopyExc)
{
ConsoleLog("Copy has Exception: " + CopyExc.Message);
}
//旧的位置
string changepk = Environment.SystemDirectory + "\\changepk.exe";
if (is_auto == true)
{
actbtn.Dispatcher.Invoke(new Action(() =>
{
system = this.SystemEditionText.Text;
}));
actbtn.Dispatcher.Invoke(new Action(() =>
{
this.activatingtext.Text = (string)this.Resources["RunAct_Getting_Key"]; //提示正在获取密钥
ShowBallSameDig();
}));
//获取密钥和SKU
try
{
string json;
try
{
json = GetHttpWebRequest(MainServerDomain + "/api/digital?list=0&ver=4"); // 主要服务器
}
catch (Exception e)
{
ConsoleLog("MainServer:" + MainServerDomain + " is not working.");
ConsoleLog("Error Message:" + e.Message);
ConsoleLog("Ready to use BackupServer:" + BackupServerDomain);
json = GetHttpWebRequest(BackupServerDomain + "/api/digital?list=0&ver=4"); // 备用服务器
}
JObject jsonobj = JObject.Parse(json);
List<Frequency> list = new List<Frequency>();
ositems = (JArray)jsonobj["OS"];
key = jsonobj[system]["key"].ToString();
sku = jsonobj[system]["sku"].ToString();
ConsoleLog("Edition:" + system + "\r\nKEY:" + key + "\r\nSKU:" + sku);
string selecos = "";
// 获取当前选择的选择的文本
actbtn.Dispatcher.Invoke(new Action(() =>
{
selecos = SystemEditionText.Text;
}));
ConsoleLog("Selected OS: " + selecos);
if (sku == "unknow")
{
mode = "2";
}
if (selecos.ToUpper().StartsWith("(Offline-KMS)".ToUpper()))
{
ConsoleLog("Switch Mode Offline-KMS");
mode = "4";
}
}
catch
{
code = "-0";
msg = (string)this.Resources["ErrorMsg-0"]; // "激活Windows10需要网络获取产品密钥 :) \nActivate Windows 10 requires a network to gets the product key :)";
goto EndLine;
}
}
else
{
actbtn.Dispatcher.Invoke(new Action(() =>
{
key = this.SystemEditionTextInput.Text;
}));
mode = "3";
sku = "unknow";
}
actbtn.Dispatcher.Invoke(new Action(() =>
{
this.activatingtext.Text = (string)this.Resources["RunAct_Uninstalling_old_Key"]; //提示正在卸载旧密钥
ShowBallSameDig();
}));
//卸载
string runend = RunCScript(slmgr_self, "-upk").Trim();
//string runend = RunCMD(@"cscript.exe /nologo %systemroot%\system32\slmgr.vbs -upk").Trim();
ConsoleLog(runend);
if (runend.EndsWith("successfully.") || runend.EndsWith("not found."))
{
RunCScript(slmgr_self, "-ckms").Trim();
if (mode == "4")
{
//长期KMS
RunCMD(@"sc stop sppsvc");
RunCMD(@"del /F /Q %systemroot%\system32\spp\store\2.0\tokens.dat");
RunCMD(@"del /F /Q %systemroot%\system32\spp\store\2.0\data.dat");
RunCMD(@"del /F /Q %systemroot%\system32\spp\store\2.0\cache\cache.dat");
RunCMD(@"sc start sppsvc");
}
if (sku == "unknow")//if (mode == "2" || mode == "3") //获取SKU
{
actbtn.Dispatcher.Invoke(new Action(() =>
{
this.activatingtext.Text = (string)this.Resources["RunAct_Getting_edition_code_Exp"]; // "Getting edition code (Experimental)";
ShowBallSameDig();
}));
//安装转换密钥
runend = RunCScript(slmgr_self, "-ipk " + key);
//runend = RunCMD(@"cscript.exe /nologo %systemroot%\system32\slmgr.vbs -ipk " + key);
ConsoleLog(slmgr_self + " -ipk " + key);
ConsoleLog(runend);
if (runend.Trim().EndsWith("successfully."))
{
Thread.Sleep(6000); //等待6秒,确保SKU生效
sku = GetSKU(); //获取SKU
if (sku != "Error")
{
actbtn.Dispatcher.Invoke(new Action(() =>
{
this.activatingtext.Text = (string)this.Resources["RunAct_Uninstalling_old_Key_Exp"]; //提示正在卸载旧密钥(实验性)
ShowBallSameDig();
}));
runend = RunCScript(slmgr_self, "-upk").Trim();
//runend = RunCMD(@"cscript.exe /nologo %systemroot%\system32\slmgr.vbs -upk").Trim();
ConsoleLog(runend);
if (runend.EndsWith("successfully.") || runend.EndsWith("not found."))
{
actbtn.Dispatcher.Invoke(new Action(() =>
{
this.activatingtext.Text = (string)this.Resources["RunAct_Prepare_for_the_next_step_Exp"]; // "Prepare for the next step (Experimental)";
ShowBallSameDig();
}));
}
}
else
{
code = "-1.2";
msg = (string)this.Resources["ErrorMsg-1.2"]; // "无法获取版本代号 :(\nCannot to get edition code. :(";
goto EndLine;
}
}
else
{
code = "-1.1";
msg = (string)this.Resources["ErrorMsg-1.1"]; // "无法安装密钥,可能没有选择或输入正确的版本 :(\nCannot to install key, may be you choose or enter a incorrect version. :(";
goto EndLine;
}
}
actbtn.Dispatcher.Invoke(new Action(() =>
{
this.activatingtext.Text = (string)this.Resources["RunAct_Installing_Key"]; //提示正在安装密钥
ShowBallSameDig();
}));
//安装数字权利升级密钥
runend = RunCScript(slmgr_self, "-ipk " + key);
//runend = RunCMD(@"cscript.exe /nologo %systemroot%\system32\slmgr.vbs -ipk " + key);
ConsoleLog(slmgr_self + " -ipk " + key);
ConsoleLog(runend);
if (runend.Trim().EndsWith("successfully."))
{
actbtn.Dispatcher.Invoke(new Action(() =>
{
this.activatingtext.Text = (string)this.Resources["RunAct_Getting_free_upgrade_permissions"]; // "Getting free upgrade permissions";
ShowBallSameDig();
}));
string ticket = null;
try
{
RegistryKey registryKey = Registry.LocalMachine.OpenSubKey("SYSTEM\\CurrentControlSet\\Control\\ProductOptions", true);
var packageFamilyName = registryKey.GetValue("OSProductPfn").ToString();
try
{
if (mode == "4")
{
//长期KMS
ticket = GetHttpWebRequest(StaticServerDomain + "/Tickets/KMS.xml");
}
else
{
ticket = GetHttpWebRequest(StaticServerDomain + "/Tickets/" + packageFamilyName + ".xml");
}
//System.Windows.MessageBox.Show(ticket);
}
catch (Exception e)
{
ConsoleLog("StaticServer:" + StaticServerDomain + " is not working.");
ConsoleLog("Error Message:" + e.Message);
}
}
catch (Exception e)
{
ConsoleLog("Get PackageFamilyName failed.");
ConsoleLog("Error Message:" + e.Message);
}
File.WriteAllText(tempfile + "GenuineTicketvNext.xml", ticket, Encoding.UTF8);
ConsoleLog("进入下一步(CUR:VNEXT)");
var hasvNextTicket = File.Exists(tempfile + "GenuineTicketvNext.xml");
if (hasvNextTicket)
{
actbtn.Dispatcher.Invoke(new Action(() =>
{
this.activatingtext.Text = (string)this.Resources["RunAct_Getting_digital_license"]; // "Getting digital license";
ShowBallSameDig();
}));
RunCMD(@"sc start wuauserv");
RunCMD(@"sc start clipsvc");
RunCMD(@"clipup -v -o -altto " + tempfile);
RunCMD(@"clipup -v -o -altto " + tempfile.TrimEnd('\\')); // 旧版本系统的 ClipUp 路径不能带最后的反斜杠
if (OSVersionInfo.BuildVersion >= 20348)
{
RunCLI(tempfile + "ClipUp.exe", ".", "-v -o -altto " + tempfile); // 固定版本解决 22H2 后 ARM64 许可证接收问题
RunCLI(tempfile + "ClipUp.exe", ".", "-v -o -altto " + tempfile.TrimEnd('\\'));
}
actbtn.Dispatcher.Invoke(new Action(() =>
{
this.activatingtext.Text = (string)this.Resources["RunAct_Activating"]; // 提示激活中
ShowBallSameDig();
}));
int try_max_count = 30;
for (int i = 0; i < try_max_count + 1; i++)
{
if (!File.Exists(tempfile + "GenuineTicketvNext.xml"))
{
break;
}
Thread.Sleep(1000);
ConsoleLog($"应用许可证 重试 {i}/{try_max_count}");
}
runend = RunCScript(slmgr_self, "-ato").Trim();
ConsoleLog(runend);
var xprrunend = RunCScript(slmgr_self, "-xpr").Trim();
var activated = (xprrunend.Contains("activated") || xprrunend.Contains("activation will expire"));
ConsoleLog(xprrunend);
if (runend.EndsWith("successfully.") || activated || runend.Contains("0xC004C003")) // Error 0xC004C003: The activation server determined that the specified product key is blocked. 是因为未连接激活服务器,下次连接时会自动激活。
{
if (runend.Contains("0xC004C003"))
{
is_not_network_to_act = true;
}
code = "200";
}
else
{
code = "-4";
msg = (string)this.Resources["ErrorMsg-4"] + "\r\n" + (string)this.Resources["SysMsg"] + "\r\n" + runend; // "激活失败 :(\nActivation Failed. :(";
}
}
else
{
code = "-3";
msg = (string)this.Resources["ErrorMsg-3"]; // "执行超时,可能没有选择正确或输入的版本 :(\nTime out, may be you choose or enter a incorrect version. :(";
}
}
else
{
code = "-2";
msg = (string)this.Resources["ErrorMsg-2"]; // "无法安装密钥,可能没有选择或输入正确的版本 :(\nCannot to install key, may be you choose or enter a incorrect version. :(";
}
}
else
{
code = "-1";
msg = (string)this.Resources["ErrorMsg-1"]; // "无法卸载旧密钥 :(\nCannot to uninstall old key. :(";
}
//string runend = RunCScript(slmgr_self, "-upk").Trim();
EndLine:;
if (code != "200")
{
actbtn.Dispatcher.Invoke(new Action(() =>
{
this.DialogActProg.IsOpen = false;
this.activatingtext.Text = (string)this.Resources["RunAct_Activating"]; //提示激活中
this.DialogWithOKToCloseDialog.IsOpen = true;
this.DialogWithOKToCloseDialogTitle.Text = (string)this.Resources["ErrorTitle"]; //错误标题
this.DialogWithOKToCloseDialogText.Text = msg + "\r\n" + (string)this.Resources["ErrorCode"] + code; //错误代码 如:错误信息\r\nCode:000
if (App.hiderun == true && App.autoact == true)
{
int tipShowMilliseconds = 0;
string tipTitle = (string)this.Resources["notifyIconTitle"];
string tipContent = msg;
ToolTipIcon tipType = ToolTipIcon.None;
notifyIcon.ShowBalloonTip(tipShowMilliseconds, tipTitle, tipContent, tipType);
Exit_Button_Click(null, null);
}
}));
//MessageBox.Show(msg + "\r\nCode:" + code);
}
else
{
actbtn.Dispatcher.Invoke(new Action(() =>
{
this.DialogActProg.IsOpen = false;
this.activatingtext.Text = (string)this.Resources["RunAct_Activating"]; //提示激活中
this.DialogWithOKToCloseDialogDonate.IsOpen = true;
this.DialogWithOKToCloseDialogDonateTitle.Text = (string)this.Resources["CompleteTitle"]; //完成标题
if (is_not_network_to_act == true)
{
this.DialogWithOKToCloseDialogDonateText.Text = (string)this.Resources["DonateTextWillActivated"]; //即将激活内容
}
else
{
this.DialogWithOKToCloseDialogDonateText.Text = (string)this.Resources["DonateTextActivated"]; //完成激活内容
}
if (App.hiderun == true && App.autoact == true)
{
int tipShowMilliseconds = 0;
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);
}
}));
//MessageBox.Show("Congratulation!");
}
DelectTempFile();
//清理文件
}
public static string RunCLI(string path, string wdPath, string var = "")
{
ConsoleLog(path + " " + var);
Wow64EnableWow64FsRedirection(false);//关闭文件重定向
//执行命令行函数
try
{
System.Diagnostics.Process myProcess = new System.Diagnostics.Process();
myProcess.StartInfo.FileName = path;//要执行的程序名称
myProcess.StartInfo.UseShellExecute = false;
myProcess.StartInfo.RedirectStandardInput = true;//可能接受来自调用程序的输入信息
myProcess.StartInfo.RedirectStandardOutput = true;//由调用程序获取输出信息
myProcess.StartInfo.CreateNoWindow = true;//不显示程序窗口
myProcess.StartInfo.Arguments = var;
myProcess.StartInfo.WorkingDirectory = wdPath;
//myProcess.Arguments = "/c chcp 65001 > nul && cmd /c \"" + PHPRuntimePath + "\" \"" + path + "\" " + var;
//myProcess.Arguments = "/c " & Commands
//myProcess.StartInfo.StandardOutputEncoding = Encoding.UTF8;
myProcess.Start();
myProcess.WaitForExit(120 * 1000);
StreamReader myStreamReader = myProcess.StandardOutput;
string myString = myStreamReader.ReadToEnd();
myProcess.Close();
ConsoleLog(myString.Trim());
ConsoleLog("执行完毕");
return myString.Trim();
}
catch
{
return "Error";
}
}
public static string RunCMD(string var)
{
ConsoleLog(var);
Wow64EnableWow64FsRedirection(false); //关闭文件重定向
//执行命令行函数
try
{
System.Diagnostics.Process myProcess = new System.Diagnostics.Process();
myProcess.StartInfo.FileName = "cmd.exe";//要执行的程序名称
myProcess.StartInfo.UseShellExecute = false;
myProcess.StartInfo.RedirectStandardInput = true;//可能接受来自调用程序的输入信息
myProcess.StartInfo.RedirectStandardOutput = true;//由调用程序获取输出信息
myProcess.StartInfo.CreateNoWindow = true;//不显示程序窗口
myProcess.StartInfo.Arguments = "/c chcp 437 > nul && cmd /c \"" + var + "\"";
//myProcess.Arguments = "/c chcp 65001 > nul && cmd /c \"" + PHPRuntimePath + "\" \"" + path + "\" " + var;
//myProcess.Arguments = "/c " & Commands
//myProcess.StartInfo.StandardOutputEncoding = Encoding.UTF8;
myProcess.Start();
myProcess.WaitForExit(60 * 1000);
System.IO.StreamReader myStreamReader = myProcess.StandardOutput;
string myString = myStreamReader.ReadToEnd();
myProcess.Close();
ConsoleLog(myString.Trim());
return myString.Trim();
}
catch
{
return "Error";
}
}
public static string RunCScript(string path, string var = "")
{
ConsoleLog("CScript" + " " + "//Nologo \"" + path + "\" " + var);
Wow64EnableWow64FsRedirection(false);//关闭文件重定向
//执行命令行函数
try
{
System.Diagnostics.Process myProcess = new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo ProcessStartInfo = new System.Diagnostics.ProcessStartInfo("CScript", "//Nologo \"" + path + "\" " + var)
{
UseShellExecute = false,
RedirectStandardOutput = true,
CreateNoWindow = true,
//myProcessStartInfo.Arguments = "/c chcp 65001 > nul && cmd /c \"" + PHPRuntimePath + "\" \"" + path + "\" " + var;
//myProcessStartInfo.Arguments = "/c " & Commands
StandardOutputEncoding = Encoding.UTF8
};
myProcess.StartInfo = ProcessStartInfo;
myProcess.Start();
myProcess.WaitForExit(60 * 1000);
System.IO.StreamReader myStreamReader = myProcess.StandardOutput;
string myString = myStreamReader.ReadToEnd();
myProcess.Close();
ConsoleLog(myString.Trim());
return myString.Trim();
}
catch
{
return "Error";
}
}
public static string GetSKU()
{
ConsoleLog("Geting SKU");
Wow64EnableWow64FsRedirection(false);//关闭文件重定向
//执行命令行函数
try
{
System.Diagnostics.Process myProcess = new System.Diagnostics.Process();
myProcess.StartInfo.FileName = "cmd.exe";//要执行的程序名称
myProcess.StartInfo.UseShellExecute = false;
myProcess.StartInfo.RedirectStandardOutput = true;
myProcess.StartInfo.CreateNoWindow = true;
myProcess.StartInfo.Arguments = "/c wmic os get OperatingSystemSKU";
//myProcess.Arguments = "/c chcp 65001 > nul && cmd /c \"" + PHPRuntimePath + "\" \"" + path + "\" " + var;
//myProcess.Arguments = "/c " & Commands
myProcess.StartInfo.StandardOutputEncoding = Encoding.UTF8;
myProcess.Start();
myProcess.WaitForExit(60 * 1000);
System.IO.StreamReader myStreamReader = myProcess.StandardOutput;
string myString = myStreamReader.ReadToEnd();
myProcess.Close();
myString = Regex.Replace(myString, @"[^0-9]+", "");
ConsoleLog("Get SKU:\"" + myString.Trim() + "\"");
return myString.Trim(); //只保留数字SKU
}
catch
{
return "Error";
}
}
private void Donate_Button_Click(object sender, RoutedEventArgs e)
{
System.Diagnostics.Process.Start("https://cmwtat.cloudmoe.com/donate"); // 打开捐赠页
this.DialogWithOKToCloseDialogDonate.IsOpen = false;
}
string last_key = "";
private void SystemEditionTextInput_TextChanged(object sender, TextChangedEventArgs e)
{
if (SystemEditionTextInput.Text != last_key)
{
int selectlen = SystemEditionTextInput.SelectionStart;
string temp = SystemEditionTextInput.Text;
temp = Regex.Replace(temp, @"[^a-zA-Z0-9]+", "");//XAML禁用输入法,并替换可能粘贴进的意外字符
temp = Regex.Replace(temp, @"([a-zA-Z0-9]{5}(?!$))", "$1-");
//temp = string.Join("-", Regex.Matches(temp, @".....").Cast<Match>().ToList());
SystemEditionTextInput.Text = temp.ToUpper();
last_key = SystemEditionTextInput.Text;
SystemEditionTextInput.SelectionStart = SystemEditionTextInput.Text.Length;
}
UpdateInputMatch(); // 更新按钮启用状态
}
/// <summary>
/// 验证产品密钥字符串是否匹配正则表达式描述的规则并更新按钮状态(如果自动模式则启用按钮)
/// </summary>
private void UpdateInputMatch()
{
//防止初始化前访问null出错
try
{
if (actbtn != null)
{
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)
{
SystemEditionText.Visibility = Visibility.Visible;
SystemEditionTextInput.Visibility = Visibility.Hidden;
is_auto = true;
UpdateInputMatch(); // 更新按钮启用状态
}
private void M_RadioButton_Checked(object sender, RoutedEventArgs e)
{
SystemEditionText.Visibility = Visibility.Hidden;
SystemEditionTextInput.Visibility = Visibility.Visible;
is_auto = false;
UpdateInputMatch(); // 更新按钮启用状态
}
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
DelectTempFile();
notifyIcon.Visible = false;
}
private void UpdateBtn_Click(object sender, RoutedEventArgs e)
{
System.Diagnostics.Process.Start("https://cmwtat.cloudmoe.com"); // 打开官网
}
private void Window_Activated(object sender, EventArgs e)
{
CheckWindowsTheme();
ApplyBase(isDark); // 应用颜色
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
CheckWindowsTheme();
ConsoleLog("Windows Theme Mode is: " + WindowsTheme);
GetEdition(); // 获取程序版本
//autoact = App.autoact;
//hiderun = App.hiderun;
//expact = App.expact;
//log2file = App.log2file;
//showhelp = App.showhelp;
//MessageBox.Show("A:" + autoact.ToString() + ";H:" + hiderun.ToString());
ApplyBase(isDark);
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 (App.showhelp == true)
{
DialogHelp.IsOpen = true;
}
notifyIcon = new NotifyIcon
{
Text = (string)this.Resources["notifyIconTitle"], //托盘图标标题
Icon = Properties.Resources.CMWTAT_ICON
}; // 先初始化托盘图标,以方便语言缺省时提示
if ((App.hiderun == true && App.autoact == true) || NotSupportLang == true)
{
//notifyIcon.BalloonTipText = "The app has been minimised. Click the tray icon to show.";
//notifyIcon.BalloonTipTitle = "The App";
//notifyIcon.Icon = new System.Drawing.Icon("TheAppIcon.ico");
//notifyIcon.Click += new EventHandler(notifyIcon_Click);
notifyIcon.Visible = true;
//打开菜单项
//System.Windows.Forms.MenuItem open = new System.Windows.Forms.MenuItem("Open");
//open.Click += new EventHandler((o, e) =>
//{
// this.Show();
//});
//退出菜单项
System.Windows.Forms.MenuItem exit = new System.Windows.Forms.MenuItem("Exit");
exit.Click += new EventHandler(Exit_Button_Click);
//关联托盘控件
//System.Windows.Forms.MenuItem[] childen = new System.Windows.Forms.MenuItem[] { open, exit };
System.Windows.Forms.MenuItem[] childen = new System.Windows.Forms.MenuItem[] { exit };
notifyIcon.ContextMenu = new System.Windows.Forms.ContextMenu(childen);
//this.notifyIcon.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler((o, e) =>
//{
// 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 (App.hiderun == true && App.autoact == true)
{
this.Hide();
int tipShowMilliseconds = 0;
string tipTitle = (string)this.Resources["notifyIconTitle"]; //通知气泡标题
string tipContent = (string)this.Resources["Running"]; //提示正在运行
ToolTipIcon tipType = ToolTipIcon.None;
notifyIcon.ShowBalloonTip(tipShowMilliseconds, tipTitle, tipContent, tipType);
//notifyIcon.BalloonTipClicked += new EventHandler((o, e) =>
//{
// //System.Windows.MessageBox.Show(System.Windows.Forms.Control.MouseButtons.ToString());
// if (System.Windows.Forms.Control.MouseButtons == MouseButtons.None) //左键返回不是Right是None
// {
// System.Windows.MessageBox.Show("Hello");
// };
//});
}
//初始化动态表单数据绑定
DataContext = new Domain.ViewModel();
this.DialogHostGrid.Visibility = Visibility.Visible;
DialogWait.IsOpen = true;
try
{
RegistryKey pRegKey = Registry.LocalMachine;
pRegKey = pRegKey.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion");
SystemEdition = pRegKey.GetValue("EditionID").ToString();
}
catch
{
SystemEdition = OSVersionInfo.Edition;
}
//SystemEditionText.Text = SystemEdition;
Thread loadthread = new Thread(LoadOSList);
loadthread.Start();
CheckWindowsCore();
}
}
}
================================================
FILE: CMWTAT_DIGITAL/OSVersionInfoClass.cs
================================================
using Microsoft.Win32;
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
// http://www.codeproject.com/Articles/73000/Getting-Operating-System-Version-Info-Even-for-Win
//https://en.wikipedia.org/wiki/List_of_Microsoft_Windows_versions
//Thanks to Member 7861383, Scott Vickery for the Windows 8.1 update and workaround.
//I have moved it to the beginning of the Name property, though...
//Thakts to Brisingr Aerowing for help with the Windows 10 adapatation
namespace OSVersionInfoClass
{
/// <summary>
/// Provides detailed information about the host operating system.
/// </summary>
public static class OSVersionInfo
{
#region ENUMS
public enum SoftwareArchitecture
{
Unknown = 0,
Bit32 = 1,
Bit64 = 2
}
public enum ProcessorArchitecture
{
Unknown = 0,
Bit32 = 1,
Bit64 = 2,
Itanium64 = 3
}
#endregion ENUMS
#region DELEGATE DECLARATION
private delegate bool IsWow64ProcessDelegate([In] IntPtr handle, [Out] out bool isWow64Process);
#endregion DELEGATE DECLARATION
#region BITS
/// <summary>
/// Determines if the current application is 32 or 64-bit.
/// </summary>
static public SoftwareArchitecture ProgramBits
{
get
{
SoftwareArchitecture pbits = SoftwareArchitecture.Unknown;
System.Collections.IDictionary test = Environment.GetEnvironmentVariables();
switch (IntPtr.Size * 8)
{
case 64:
pbits = SoftwareArchitecture.Bit64;
break;
case 32:
pbits = SoftwareArchitecture.Bit32;
break;
default:
pbits = SoftwareArchitecture.Unknown;
break;
}
return pbits;
}
}
static public SoftwareArchitecture OSBits
{
get
{
SoftwareArchitecture osbits = SoftwareArchitecture.Unknown;
switch (IntPtr.Size * 8)
{
case 64:
osbits = SoftwareArchitecture.Bit64;
break;
case 32:
if (Is32BitProcessOn64BitProcessor())
osbits = SoftwareArchitecture.Bit64;
else
osbits = SoftwareArchitecture.Bit32;
break;
default:
osbits = SoftwareArchitecture.Unknown;
break;
}
return osbits;
}
}
/// <summary>
/// Determines if the current processor is 32 or 64-bit.
/// </summary>
static public ProcessorArchitecture ProcessorBits
{
get
{
ProcessorArchitecture pbits = ProcessorArchitecture.Unknown;
try
{
SYSTEM_INFO l_System_Info = new SYSTEM_INFO();
GetNativeSystemInfo(ref l_System_Info);
switch (l_System_Info.uProcessorInfo.wProcessorArchitecture)
{
case 9: // PROCESSOR_ARCHITECTURE_AMD64
pbits = ProcessorArchitecture.Bit64;
break;
case 6: // PROCESSOR_ARCHITECTURE_IA64
pbits = ProcessorArchitecture.Itanium64;
break;
case 0: // PROCESSOR_ARCHITECTURE_INTEL
pbits = ProcessorArchitecture.Bit32;
break;
default: // PROCESSOR_ARCHITECTURE_UNKNOWN
pbits = ProcessorArchitecture.Unknown;
break;
}
}
catch
{
// Ignore
}
return pbits;
}
}
#endregion BITS
#region EDITION
static private string s_Edition;
/// <summary>
/// Gets the edition of the operating system running on this computer.
/// </summary>
static public string Edition
{
get
{
if (s_Edition != null)
return s_Edition; //***** RETURN *****//
string edition = String.Empty;
OperatingSystem osVersion = Environment.OSVersion;
OSVERSIONINFOEX osVersionInfo = new OSVERSIONINFOEX();
osVersionInfo.dwOSVersionInfoSize = Marshal.SizeOf(typeof(OSVERSIONINFOEX));
if (GetVersionEx(ref osVersionInfo))
{
int majorVersion = osVersion.Version.Major;
int minorVersion = osVersion.Version.Minor;
byte productType = osVersionInfo.wProductType;
short suiteMask = osVersionInfo.wSuiteMask;
#region VERSION 4
if (majorVersion == 4)
{
if (productType == VER_NT_WORKSTATION)
{
// Windows NT 4.0 Workstation
edition = "Workstation";
}
else if (productType == VER_NT_SERVER)
{
if ((suiteMask & VER_SUITE_ENTERPRISE) != 0)
{
// Windows NT 4.0 Server Enterprise
edition = "Enterprise Server";
}
else
{
// Windows NT 4.0 Server
edition = "Standard Server";
}
}
}
#endregion VERSION 4
#region VERSION 5
else if (majorVersion == 5)
{
if (productType == VER_NT_WORKSTATION)
{
if ((suiteMask & VER_SUITE_PERSONAL) != 0)
{
edition = "Home";
}
else
{
if (GetSystemMetrics(86) == 0) // 86 == SM_TABLETPC
edition = "Professional";
else
edition = "Tablet Edition";
}
}
else if (productType == VER_NT_SERVER)
{
if (minorVersion == 0)
{
if ((suiteMask & VER_SUITE_DATACENTER) != 0)
{
// Windows 2000 Datacenter Server
edition = "Datacenter Server";
}
else if ((suiteMask & VER_SUITE_ENTERPRISE) != 0)
{
// Windows 2000 Advanced Server
edition = "Advanced Server";
}
else
{
// Windows 2000 Server
edition = "Server";
}
}
else
{
if ((suiteMask & VER_SUITE_DATACENTER) != 0)
{
// Windows Server 2003 Datacenter Edition
edition = "Datacenter";
}
else if ((suiteMask & VER_SUITE_ENTERPRISE) != 0)
{
// Windows Server 2003 Enterprise Edition
edition = "Enterprise";
}
else if ((suiteMask & VER_SUITE_BLADE) != 0)
{
// Windows Server 2003 Web Edition
edition = "Web Edition";
}
else
{
// Windows Server 2003 Standard Edition
edition = "Standard";
}
}
}
}
#endregion VERSION 5
#region VERSION 6
else if (majorVersion == 6)
{
int ed;
if (GetProductInfo(majorVersion, minorVersion,
osVersionInfo.wServicePackMajor, osVersionInfo.wServicePackMinor,
out ed))
{
switch (ed)
{
case PRODUCT_BUSINESS:
edition = "Business";
break;
case PRODUCT_BUSINESS_N:
edition = "Business N";
break;
case PRODUCT_CLUSTER_SERVER:
edition = "HPC Edition";
break;
case PRODUCT_CLUSTER_SERVER_V:
edition = "HPC Edition without Hyper-V";
break;
case PRODUCT_DATACENTER_SERVER:
edition = "Datacenter Server";
break;
case PRODUCT_DATACENTER_SERVER_CORE:
edition = "Datacenter Server (core installation)";
break;
case PRODUCT_DATACENTER_SERVER_V:
edition = "Datacenter Server without Hyper-V";
break;
case PRODUCT_DATACENTER_SERVER_CORE_V:
edition = "Datacenter Server without Hyper-V (core installation)";
break;
case PRODUCT_EMBEDDED:
edition = "Embedded";
break;
case PRODUCT_ENTERPRISE:
edition = "Enterprise";
break;
case PRODUCT_ENTERPRISE_N:
edition = "Enterprise N";
break;
case PRODUCT_ENTERPRISE_E:
edition = "Enterprise E";
break;
case PRODUCT_ENTERPRISE_SERVER:
edition = "Enterprise Server";
break;
case PRODUCT_ENTERPRISE_SERVER_CORE:
edition = "Enterprise Server (core installation)";
break;
case PRODUCT_ENTERPRISE_SERVER_CORE_V:
edition = "Enterprise Server without Hyper-V (core installation)";
break;
case PRODUCT_ENTERPRISE_SERVER_IA64:
edition = "Enterprise Server for Itanium-based Systems";
break;
case PRODUCT_ENTERPRISE_SERVER_V:
edition = "Enterprise Server without Hyper-V";
break;
case PRODUCT_ESSENTIALBUSINESS_SERVER_MGMT:
edition = "Essential Business Server MGMT";
break;
case PRODUCT_ESSENTIALBUSINESS_SERVER_ADDL:
edition = "Essential Business Server ADDL";
break;
case PRODUCT_ESSENTIALBUSINESS_SERVER_MGMTSVC:
edition = "Essential Business Server MGMTSVC";
break;
case PRODUCT_ESSENTIALBUSINESS_SERVER_ADDLSVC:
edition = "Essential Business Server ADDLSVC";
break;
case PRODUCT_HOME_BASIC:
edition = "Home Basic";
break;
case PRODUCT_HOME_BASIC_N:
edition = "Home Basic N";
break;
case PRODUCT_HOME_BASIC_E:
edition = "Home Basic E";
break;
case PRODUCT_HOME_PREMIUM:
edition = "Home Premium";
break;
case PRODUCT_HOME_PREMIUM_N:
edition = "Home Premium N";
break;
case PRODUCT_HOME_PREMIUM_E:
edition = "Home Premium E";
break;
case PRODUCT_HOME_PREMIUM_SERVER:
edition = "Home Premium Server";
break;
case PRODUCT_HYPERV:
edition = "Microsoft Hyper-V Server";
break;
case PRODUCT_MEDIUMBUSINESS_SERVER_MANAGEMENT:
edition = "Windows Essential Business Management Server";
break;
case PRODUCT_MEDIUMBUSINESS_SERVER_MESSAGING:
edition = "Windows Essential Business Messaging Server";
break;
case PRODUCT_MEDIUMBUSINESS_SERVER_SECURITY:
edition = "Windows Essential Business Security Server";
break;
case PRODUCT_PROFESSIONAL:
edition = "Professional";
break;
case PRODUCT_PROFESSIONAL_N:
edition = "Professional N";
break;
case PRODUCT_PROFESSIONAL_E:
edition = "Professional E";
break;
case PRODUCT_SB_SOLUTION_SERVER:
edition = "SB Solution Server";
break;
case PRODUCT_SB_SOLUTION_SERVER_EM:
edition = "SB Solution Server EM";
break;
case PRODUCT_SERVER_FOR_SB_SOLUTIONS:
edition = "Server for SB Solutions";
break;
case PRODUCT_SERVER_FOR_SB_SOLUTIONS_EM:
edition = "Server for SB Solutions EM";
break;
case PRODUCT_SERVER_FOR_SMALLBUSINESS:
edition = "Windows Essential Server Solutions";
break;
case PRODUCT_SERVER_FOR_SMALLBUSINESS_V:
edition = "Windows Essential Server Solutions without Hyper-V";
break;
case PRODUCT_SERVER_FOUNDATION:
edition = "Server Foundation";
break;
case PRODUCT_SMALLBUSINESS_SERVER:
edition = "Windows Small Business Server";
break;
case PRODUCT_SMALLBUSINESS_SERVER_PREMIUM:
edition = "Windows Small Business Server Premium";
break;
case PRODUCT_SMALLBUSINESS_SERVER_PREMIUM_CORE:
edition = "Windows Small Business Server Premium (core installation)";
break;
case PRODUCT_SOLUTION_EMBEDDEDSERVER:
edition = "Solution Embedded Server";
break;
case PRODUCT_SOLUTION_EMBEDDEDSERVER_CORE:
edition = "Solution Embedded Server (core installation)";
break;
case PRODUCT_STANDARD_SERVER:
edition = "Standard Server";
break;
case PRODUCT_STANDARD_SERVER_CORE:
edition = "Standard Server (core installation)";
break;
case PRODUCT_STANDARD_SERVER_SOLUTIONS:
edition = "Standard Server Solutions";
break;
case PRODUCT_STANDARD_SERVER_SOLUTIONS_CORE:
edition = "Standard Server Solutions (core installation)";
break;
case PRODUCT_STANDARD_SERVER_CORE_V:
edition = "Standard Server without Hyper-V (core installation)";
break;
case PRODUCT_STANDARD_SERVER_V:
edition = "Standard Server without Hyper-V";
break;
case PRODUCT_STARTER:
edition = "Starter";
break;
case PRODUCT_STARTER_N:
edition = "Starter N";
break;
case PRODUCT_STARTER_E:
edition = "Starter E";
break;
case PRODUCT_STORAGE_ENTERPRISE_SERVER:
edition = "Enterprise Storage Server";
break;
case PRODUCT_STORAGE_ENTERPRISE_SERVER_CORE:
edition = "Enterprise Storage Server (core installation)";
break;
case PRODUCT_STORAGE_EXPRESS_SERVER:
edition = "Express Storage Server";
break;
case PRODUCT_STORAGE_EXPRESS_SERVER_CORE:
edition = "Express Storage Server (core installation)";
break;
case PRODUCT_STORAGE_STANDARD_SERVER:
edition = "Standard Storage Server";
break;
case PRODUCT_STORAGE_STANDARD_SERVER_CORE:
edition = "Standard Storage Server (core installation)";
break;
case PRODUCT_STORAGE_WORKGROUP_SERVER:
edition = "Workgroup Storage Server";
break;
case PRODUCT_STORAGE_WORKGROUP_SERVER_CORE:
edition = "Workgroup Storage Server (core installation)";
break;
case PRODUCT_UNDEFINED:
edition = "Unknown product";
break;
case PRODUCT_ULTIMATE:
edition = "Ultimate";
break;
case PRODUCT_ULTIMATE_N:
edition = "Ultimate N";
break;
case PRODUCT_ULTIMATE_E:
edition = "Ultimate E";
break;
case PRODUCT_WEB_SERVER:
edition = "Web Server";
break;
case PRODUCT_WEB_SERVER_CORE:
edition = "Web Server (core installation)";
break;
}
}
}
#endregion VERSION 6
}
s_Edition = edition;
return edition;
}
}
#endregion EDITION
#region NAME
static private string s_Name;
/// <summary>
/// Gets the name of the operating system running on this computer.
/// </summary>
static public string Name
{
get
{
if (s_Name != null)
return s_Name; //***** RETURN *****//
string name = "unknown";
OperatingSystem osVersion = Environment.OSVersion;
OSVERSIONINFOEX osVersionInfo = new OSVERSIONINFOEX();
osVersionInfo.dwOSVersionInfoSize = Marshal.SizeOf(typeof(OSVERSIONINFOEX));
if (GetVersionEx(ref osVersionInfo))
{
int majorVersion = osVersion.Version.Major;
int minorVersion = osVersion.Version.Minor;
if (majorVersion == 6 && minorVersion == 2)
{
//The registry read workaround is by Scott Vickery. Thanks a lot for the help!
//http://msdn.microsoft.com/en-us/library/windows/desktop/ms724832(v=vs.85).aspx
// For applications that have been manifested for Windows 8.1 & Windows 10. Applications not manifested for 8.1 or 10 will return the Windows 8 OS version value (6.2).
// By reading the registry, we'll get the exact version - meaning we can even compare against Win 8 and Win 8.1.
string exactVersion = RegistryRead(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "CurrentVersion", "");
if (!string.IsNullOrEmpty(exactVersion))
{
string[] splitResult = exactVersion.Split('.');
majorVersion = Convert.ToInt32(splitResult[0]);
minorVersion = Convert.ToInt32(splitResult[1]);
}
if (IsWindows10())
{
majorVersion = 10;
minorVersion = 0;
}
}
switch (osVersion.Platform)
{
case PlatformID.Win32S:
name = "Windows 3.1";
break;
case PlatformID.WinCE:
name = "Windows CE";
break;
case PlatformID.Win32Windows:
{
if (majorVersion == 4)
{
string csdVersion = osVersionInfo.szCSDVersion;
switch (minorVersion)
{
case 0:
if (csdVersion == "B" || csdVersion == "C")
name = "Windows 95 OSR2";
else
name = "Windows 95";
break;
case 10:
if (csdVersion == "A")
name = "Windows 98 Second Edition";
else
name = "Windows 98";
break;
case 90:
name = "Windows Me";
break;
}
}
break;
}
case PlatformID.Win32NT:
{
byte productType = osVersionInfo.wProductType;
switch (majorVersion)
{
case 3:
name = "Windows NT 3.51";
break;
case 4:
switch (productType)
{
case 1:
name = "Windows NT 4.0";
break;
case 3:
name = "Windows NT 4.0 Server";
break;
}
break;
case 5:
switch (minorVersion)
{
case 0:
name = "Windows 2000";
break;
case 1:
name = "Windows XP";
break;
case 2:
name = "Windows Server 2003";
break;
}
break;
case 6:
switch (minorVersion)
{
case 0:
switch (productType)
{
case 1:
name = "Windows Vista";
break;
case 3:
name = "Windows Server 2008";
break;
}
break;
case 1:
switch (productType)
{
case 1:
name = "Windows 7";
break;
case 3:
name = "Windows Server 2008 R2";
break;
}
break;
case 2:
switch (productType)
{
case 1:
name = "Windows 8";
break;
case 3:
name = "Windows Server 2012";
break;
}
break;
case 3:
switch (productType)
{
case 1:
name = "Windows 8.1";
break;
case 3:
name = "Windows Server 2012 R2";
break;
}
break;
}
break;
case 10:
switch (minorVersion)
{
case 0:
switch (productType)
{
case 1:
name = "Windows 10";
break;
case 3:
name = "Windows Server 2016";
break;
}
break;
}
break;
}
break;
}
}
}
s_Name = name;
return name;
}
}
#endregion NAME
#region PINVOKE
#region GET
#region PRODUCT INFO
[DllImport("Kernel32.dll")]
internal static extern bool GetProductInfo(
int osMajorVersion,
int osMinorVersion,
int spMajorVersion,
int spMinorVersion,
out int edition);
#endregion PRODUCT INFO
#region VERSION
[DllImport("kernel32.dll")]
private static extern bool GetVersionEx(ref OSVERSIONINFOEX osVersionInfo);
#endregion VERSION
#region SYSTEMMETRICS
[DllImport("user32")]
public static extern int GetSystemMetrics(int nIndex);
#endregion SYSTEMMETRICS
#region SYSTEMINFO
[DllImport("kernel32.dll")]
public static extern void GetSystemInfo([MarshalAs(UnmanagedType.Struct)] ref SYSTEM_INFO lpSystemInfo);
[DllImport("kernel32.dll")]
public static extern void GetNativeSystemInfo([MarshalAs(UnmanagedType.Struct)] ref SYSTEM_INFO lpSystemInfo);
#endregion SYSTEMINFO
#endregion GET
#region OSVERSIONINFOEX
[StructLayout(LayoutKind.Sequential)]
private struct OSVERSIONINFOEX
{
public int dwOSVersionInfoSize;
public int dwMajorVersion;
public int dwMinorVersion;
public int dwBuildNumber;
public int dwPlatformId;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
public string szCSDVersion;
public short wServicePackMajor;
public short wServicePackMinor;
public short wSuiteMask;
public byte wProductType;
public byte wReserved;
}
#endregion OSVERSIONINFOEX
#region SYSTEM_INFO
[StructLayout(LayoutKind.Sequential)]
public struct SYSTEM_INFO
{
internal _PROCESSOR_INFO_UNION uProcessorInfo;
public uint dwPageSize;
public IntPtr lpMinimumApplicationAddress;
public IntPtr lpMaximumApplicationAddress;
public IntPtr dwActiveProcessorMask;
public uint dwNumberOfProcessors;
public uint dwProcessorType;
public uint dwAllocationGranularity;
public ushort dwProcessorLevel;
public ushort dwProcessorRevision;
}
#endregion SYSTEM_INFO
#region _PROCESSOR_INFO_UNION
[StructLayout(LayoutKind.Explicit)]
public struct _PROCESSOR_INFO_UNION
{
[FieldOffset(0)]
internal uint dwOemId;
[FieldOffset(0)]
internal ushort wProcessorArchitecture;
[FieldOffset(2)]
internal ushort wReserved;
}
#endregion _PROCESSOR_INFO_UNION
#region 64 BIT OS DETECTION
[DllImport("kernel32", SetLastError = true, CallingConvention = CallingConvention.Winapi)]
public extern static IntPtr LoadLibrary(string libraryName);
[DllImport("kernel32", SetLastError = true, CallingConvention = CallingConvention.Winapi)]
public extern static IntPtr GetProcAddress(IntPtr hwnd, string procedureName);
#endregion 64 BIT OS DETECTION
#region PRODUCT
private const int PRODUCT_UNDEFINED = 0x00000000;
private const int PRODUCT_ULTIMATE = 0x00000001;
private const int PRODUCT_HOME_BASIC = 0x00000002;
private const int PRODUCT_HOME_PREMIUM = 0x00000003;
private const int PRODUCT_ENTERPRISE = 0x00000004;
private const int PRODUCT_HOME_BASIC_N = 0x00000005;
private const int PRODUCT_BUSINESS = 0x00000006;
private const int PRODUCT_STANDARD_SERVER = 0x00000007;
private const int PRODUCT_DATACENTER_SERVER = 0x00000008;
private const int PRODUCT_SMALLBUSINESS_SERVER = 0x00000009;
private const int PRODUCT_ENTERPRISE_SERVER = 0x0000000A;
private const int PRODUCT_STARTER = 0x0000000B;
private const int PRODUCT_DATACENTER_SERVER_CORE = 0x0000000C;
private const int PRODUCT_STANDARD_SERVER_CORE = 0x0000000D;
private const int PRODUCT_ENTERPRISE_SERVER_CORE = 0x0000000E;
private const int PRODUCT_ENTERPRISE_SERVER_IA64 = 0x0000000F;
private const int PRODUCT_BUSINESS_N = 0x00000010;
private const int PRODUCT_WEB_SERVER = 0x00000011;
private const int PRODUCT_CLUSTER_SERVER = 0x00000012;
private const int PRODUCT_HOME_SERVER = 0x00000013;
private const int PRODUCT_STORAGE_EXPRESS_SERVER = 0x00000014;
private const int PRODUCT_STORAGE_STANDARD_SERVER = 0x00000015;
private const int PRODUCT_STORAGE_WORKGROUP_SERVER = 0x00000016;
private const int PRODUCT_STORAGE_ENTERPRISE_SERVER = 0x00000017;
private const int PRODUCT_SERVER_FOR_SMALLBUSINESS = 0x00000018;
private const int PRODUCT_SMALLBUSINESS_SERVER_PREMIUM = 0x00000019;
private const int PRODUCT_HOME_PREMIUM_N = 0x0000001A;
private const int PRODUCT_ENTERPRISE_N = 0x0000001B;
private const int PRODUCT_ULTIMATE_N = 0x0000001C;
private const int PRODUCT_WEB_SERVER_CORE = 0x0000001D;
private const int PRODUCT_MEDIUMBUSINESS_SERVER_MANAGEMENT = 0x0000001E;
private const int PRODUCT_MEDIUMBUSINESS_SERVER_SECURITY = 0x0000001F;
private const int PRODUCT_MEDIUMBUSINESS_SERVER_MESSAGING = 0x00000020;
private const int PRODUCT_SERVER_FOUNDATION = 0x00000021;
private const int PRODUCT_HOME_PREMIUM_SERVER = 0x00000022;
private const int PRODUCT_SERVER_FOR_SMALLBUSINESS_V = 0x00000023;
private const int PRODUCT_STANDARD_SERVER_V = 0x00000024;
private const int PRODUCT_DATACENTER_SERVER_V = 0x00000025;
private const int PRODUCT_ENTERPRISE_SERVER_V = 0x00000026;
private const int PRODUCT_DATACENTER_SERVER_CORE_V = 0x00000027;
private const int PRODUCT_STANDARD_SERVER_CORE_V = 0x00000028;
private const int PRODUCT_ENTERPRISE_SERVER_CORE_V = 0x00000029;
private const int PRODUCT_HYPERV = 0x0000002A;
private const int PRODUCT_STORAGE_EXPRESS_SERVER_CORE = 0x0000002B;
private const int PRODUCT_STORAGE_STANDARD_SERVER_CORE = 0x0000002C;
private const int PRODUCT_STORAGE_WORKGROUP_SERVER_CORE = 0x0000002D;
private const int PRODUCT_STORAGE_ENTERPRISE_SERVER_CORE = 0x0000002E;
private const int PRODUCT_STARTER_N = 0x0000002F;
private const int PRODUCT_PROFESSIONAL = 0x00000030;
private const int PRODUCT_PROFESSIONAL_N = 0x00000031;
private const int PRODUCT_SB_SOLUTION_SERVER = 0x00000032;
private const int PRODUCT_SERVER_FOR_SB_SOLUTIONS = 0x00000033;
private const int PRODUCT_STANDARD_SERVER_SOLUTIONS = 0x00000034;
private const int PRODUCT_STANDARD_SERVER_SOLUTIONS_CORE = 0x00000035;
private const int PRODUCT_SB_SOLUTION_SERVER_EM = 0x00000036;
private const int PRODUCT_SERVER_FOR_SB_SOLUTIONS_EM = 0x00000037;
private const int PRODUCT_SOLUTION_EMBEDDEDSERVER = 0x00000038;
private const int PRODUCT_SOLUTION_EMBEDDEDSERVER_CORE = 0x00000039;
//private const int ???? = 0x0000003A;
private const int PRODUCT_ESSENTIALBUSINESS_SERVER_MGMT = 0x0000003B;
private const int PRODUCT_ESSENTIALBUSINESS_SERVER_ADDL = 0x0000003C;
private const int PRODUCT_ESSENTIALBUSINESS_SERVER_MGMTSVC = 0x0000003D;
private const int PRODUCT_ESSENTIALBUSINESS_SERVER_ADDLSVC = 0x0000003E;
private const int PRODUCT_SMALLBUSINESS_SERVER_PREMIUM_CORE = 0x0000003F;
private const int PRODUCT_CLUSTER_SERVER_V = 0x00000040;
private const int PRODUCT_EMBEDDED = 0x00000041;
private const int PRODUCT_STARTER_E = 0x00000042;
private const int PRODUCT_HOME_BASIC_E = 0x00000043;
private const int PRODUCT_HOME_PREMIUM_E = 0x00000044;
private const int PRODUCT_PROFESSIONAL_E = 0x00000045;
private const int PRODUCT_ENTERPRISE_E = 0x00000046;
private const int PRODUCT_ULTIMATE_E = 0x00000047;
//private const int PRODUCT_UNLICENSED = 0xABCDABCD;
#endregion PRODUCT
#region VERSIONS
private const int VER_NT_WORKSTATION = 1;
private const int VER_NT_DOMAIN_CONTROLLER = 2;
private const int VER_NT_SERVER = 3;
private const int VER_SUITE_SMALLBUSINESS = 1;
private const int VER_SUITE_ENTERPRISE = 2;
private const int VER_SUITE_TERMINAL = 16;
private const int VER_SUITE_DATACENTER = 128;
private const int VER_SUITE_SINGLEUSERTS = 256;
private const int VER_SUITE_PERSONAL = 512;
private const int VER_SUITE_BLADE = 1024;
#endregion VERSIONS
#endregion PINVOKE
#region SERVICE PACK
/// <summary>
/// Gets the service pack informat
gitextract_3jvuoj2b/ ├── .gitattributes ├── .github/ │ └── ISSUE_TEMPLATE/ │ └── bug_report.md ├── .gitignore ├── CDNDirectRun.ps1 ├── CMWTAT_DIGITAL/ │ ├── App.xaml │ ├── App.xaml.cs │ ├── CMWTAT_DIGITAL.csproj │ ├── Domain/ │ │ ├── IsSN.cs │ │ ├── NotifyPropertyChangedExtension.cs │ │ └── ViewModel.cs │ ├── FodyWeavers.xml │ ├── Lang/ │ │ ├── en.xaml │ │ ├── fr.xaml │ │ ├── ja.xaml │ │ ├── ru.xaml │ │ └── zh.xaml │ ├── MainWindow.xaml │ ├── MainWindow.xaml.cs │ ├── OSVersionInfoClass.cs │ ├── Properties/ │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ ├── Resources.resx │ │ ├── Settings.Designer.cs │ │ └── Settings.settings │ ├── app.config │ ├── app.manifest │ └── packages.config ├── CMWTAT_DIGITAL.sln ├── DirectRun.ps1 ├── LICENSE ├── README.en.md ├── README.md ├── README.zh.md └── _config.yml
SYMBOL INDEX (71 symbols across 8 files)
FILE: CMWTAT_DIGITAL/App.xaml.cs
class App (line 9) | public partial class App : Application
method OnStartup (line 17) | protected override void OnStartup(StartupEventArgs e)
FILE: CMWTAT_DIGITAL/Domain/IsSN.cs
class IsSN (line 7) | class IsSN : ValidationRule
method IsMatch (line 17) | public static bool IsMatch(string inputStr, string patternStr)
method IsMatch (line 29) | public static bool IsMatch(string inputStr, string patternStr, bool if...
method IsMatch (line 42) | public static bool IsMatch(string inputStr, string patternStr, bool if...
method Validate (line 56) | public override ValidationResult Validate(object value, CultureInfo cu...
FILE: CMWTAT_DIGITAL/Domain/NotifyPropertyChangedExtension.cs
class NotifyPropertyChangedExtension (line 8) | public static class NotifyPropertyChangedExtension
method MutateVerbose (line 10) | public static void MutateVerbose<TField>(this INotifyPropertyChanged i...
FILE: CMWTAT_DIGITAL/Domain/ViewModel.cs
class ViewModel (line 8) | class ViewModel : INotifyPropertyChanged
method ViewModel (line 12) | public ViewModel()
method RaisePropertyChanged (line 30) | private Action<PropertyChangedEventArgs> RaisePropertyChanged()
FILE: CMWTAT_DIGITAL/MainWindow.xaml.cs
class Constants (line 23) | static class Constants
class MainWindow (line 31) | public partial class MainWindow : Window
method Wow64EnableWow64FsRedirection (line 33) | [DllImport("Kernel32.dll")]
type Frequency (line 36) | public struct Frequency
method ConsoleLog (line 42) | public static void ConsoleLog(string log_text = "")
method WriteLog (line 51) | public static void WriteLog(string strLog)
method DelectTempFile (line 80) | public void DelectTempFile()
method ExportTempFile (line 105) | public void ExportTempFile()
method LoadLang (line 140) | public void LoadLang(string LangName = Constants.DefaultLang)
method ApplyBase (line 176) | private static void ApplyBase(bool isDark)
method GetEdition (line 188) | private void GetEdition()
method CheckWindowsTheme (line 216) | public void CheckWindowsTheme()
method MainWindow (line 241) | public MainWindow()
method CheckUpdate (line 255) | private void CheckUpdate()
method LoadOSList (line 301) | private void LoadOSList()
method CheckWindowsCore (line 485) | private void CheckWindowsCore()
method Activate_Button_Click (line 495) | private void Activate_Button_Click(object sender, RoutedEventArgs e)
method installbtn_Click (line 508) | private void installbtn_Click(object sender, RoutedEventArgs e)
method upgradefullbtn_Click (line 514) | private void upgradefullbtn_Click(object sender, RoutedEventArgs e)
method UpgradeFullVersionWindows_Click (line 519) | private void UpgradeFullVersionWindows_Click(object sender, RoutedEven...
method GetHttpWebRequest (line 526) | private string GetHttpWebRequest(string url, int timeout = 10000, int ...
method Exit_Button_Click (line 566) | private void Exit_Button_Click(object sender, EventArgs e)
method RunInstall (line 573) | private void RunInstall()
method RunUpgradeFullVersion (line 733) | private void RunUpgradeFullVersion()
method ShowBallSameDig (line 752) | private void ShowBallSameDig()
method RunAct (line 767) | private void RunAct()
method RunCLI (line 1157) | public static string RunCLI(string path, string wdPath, string var = "")
method RunCMD (line 1190) | public static string RunCMD(string var)
method RunCScript (line 1221) | public static string RunCScript(string path, string var = "")
method GetSKU (line 1253) | public static string GetSKU()
method Donate_Button_Click (line 1284) | private void Donate_Button_Click(object sender, RoutedEventArgs e)
method SystemEditionTextInput_TextChanged (line 1292) | private void SystemEditionTextInput_TextChanged(object sender, TextCha...
method UpdateInputMatch (line 1311) | private void UpdateInputMatch()
method A_RadioButton_Checked (line 1342) | private void A_RadioButton_Checked(object sender, RoutedEventArgs e)
method M_RadioButton_Checked (line 1350) | private void M_RadioButton_Checked(object sender, RoutedEventArgs e)
method Window_Closing (line 1358) | private void Window_Closing(object sender, System.ComponentModel.Cance...
method UpdateBtn_Click (line 1364) | private void UpdateBtn_Click(object sender, RoutedEventArgs e)
method Window_Activated (line 1369) | private void Window_Activated(object sender, EventArgs e)
method Window_Loaded (line 1375) | private void Window_Loaded(object sender, RoutedEventArgs e)
FILE: CMWTAT_DIGITAL/OSVersionInfoClass.cs
class OSVersionInfo (line 19) | public static class OSVersionInfo
type SoftwareArchitecture (line 22) | public enum SoftwareArchitecture
type ProcessorArchitecture (line 29) | public enum ProcessorArchitecture
method GetProductInfo (line 681) | [DllImport("Kernel32.dll")]
method GetVersionEx (line 691) | [DllImport("kernel32.dll")]
method GetSystemMetrics (line 696) | [DllImport("user32")]
method GetSystemInfo (line 701) | [DllImport("kernel32.dll")]
method GetNativeSystemInfo (line 704) | [DllImport("kernel32.dll")]
type OSVERSIONINFOEX (line 711) | [StructLayout(LayoutKind.Sequential)]
type SYSTEM_INFO (line 730) | [StructLayout(LayoutKind.Sequential)]
type _PROCESSOR_INFO_UNION (line 747) | [StructLayout(LayoutKind.Explicit)]
method LoadLibrary (line 760) | [DllImport("kernel32", SetLastError = true, CallingConvention = Callin...
method GetProcAddress (line 763) | [DllImport("kernel32", SetLastError = true, CallingConvention = Callin...
method GetIsWow64ProcessDelegate (line 988) | private static IsWow64ProcessDelegate GetIsWow64ProcessDelegate()
method Is32BitProcessOn64BitProcessor (line 1005) | private static bool Is32BitProcessOn64BitProcessor()
method IsWindows10 (line 1028) | private static bool IsWindows10()
method RegistryRead (line 1042) | private static string RegistryRead(string RegistryPath, string Field, ...
FILE: CMWTAT_DIGITAL/Properties/Resources.Designer.cs
class Resources (line 22) | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resource...
method Resources (line 31) | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Mic...
FILE: CMWTAT_DIGITAL/Properties/Settings.Designer.cs
class Settings (line 14) | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
Condensed preview — 34 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (260K chars).
[
{
"path": ".gitattributes",
"chars": 66,
"preview": "# Auto detect text files and perform LF normalization\n* text=auto\n"
},
{
"path": ".github/ISSUE_TEMPLATE/bug_report.md",
"chars": 805,
"preview": "---\nname: Bug report\nabout: Create a report to help us improve\ntitle: ''\nlabels: ''\nassignees: ''\n\n---\n\n**Describe the b"
},
{
"path": ".gitignore",
"chars": 6859,
"preview": "## Ignore Visual Studio temporary files, build results, and\n## files generated by popular Visual Studio add-ons.\n##\n## G"
},
{
"path": "CDNDirectRun.ps1",
"chars": 800,
"preview": "$isAdmin = (New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole"
},
{
"path": "CMWTAT_DIGITAL/App.xaml",
"chars": 1206,
"preview": "<Application x:Class=\"CMWTAT_DIGITAL.App\"\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation"
},
{
"path": "CMWTAT_DIGITAL/App.xaml.cs",
"chars": 1530,
"preview": "using System;\nusing System.Windows;\n\nnamespace CMWTAT_DIGITAL\n{\n /// <summary>\n /// App.xaml 的交互逻辑\n /// </summ"
},
{
"path": "CMWTAT_DIGITAL/CMWTAT_DIGITAL.csproj",
"chars": 9812,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"15.0\" xmlns=\"http://schemas.microsoft.com/developer/msbui"
},
{
"path": "CMWTAT_DIGITAL/Domain/IsSN.cs",
"chars": 2901,
"preview": "using System.Globalization;\nusing System.Text.RegularExpressions;\nusing System.Windows.Controls;\n\nnamespace CMWTAT_DIGI"
},
{
"path": "CMWTAT_DIGITAL/Domain/NotifyPropertyChangedExtension.cs",
"chars": 633,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Runtime.CompilerServices;\n\nna"
},
{
"path": "CMWTAT_DIGITAL/Domain/ViewModel.cs",
"chars": 849,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Linq;\n\nnamespace CMWTAT_DIGIT"
},
{
"path": "CMWTAT_DIGITAL/FodyWeavers.xml",
"chars": 137,
"preview": "<Weavers xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"FodyWeavers.xsd\">\n <Cost"
},
{
"path": "CMWTAT_DIGITAL/Lang/en.xaml",
"chars": 9355,
"preview": "<ResourceDictionary xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\" xmlns:x=\"http://schemas.microsoft"
},
{
"path": "CMWTAT_DIGITAL/Lang/fr.xaml",
"chars": 8891,
"preview": "<ResourceDictionary xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\" xmlns:x=\"http://schemas.microsoft"
},
{
"path": "CMWTAT_DIGITAL/Lang/ja.xaml",
"chars": 7928,
"preview": "<ResourceDictionary xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\" xmlns:x=\"http://schemas.microsoft"
},
{
"path": "CMWTAT_DIGITAL/Lang/ru.xaml",
"chars": 9655,
"preview": "<ResourceDictionary xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\" xmlns:x=\"http://schemas.microsoft."
},
{
"path": "CMWTAT_DIGITAL/Lang/zh.xaml",
"chars": 6951,
"preview": "<ResourceDictionary xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\" xmlns:x=\"http://schemas.microsoft"
},
{
"path": "CMWTAT_DIGITAL/MainWindow.xaml",
"chars": 24176,
"preview": "<Window x:Class=\"CMWTAT_DIGITAL.MainWindow\"\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n "
},
{
"path": "CMWTAT_DIGITAL/MainWindow.xaml.cs",
"chars": 63181,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Runtime.InteropServices;\nusing System.T"
},
{
"path": "CMWTAT_DIGITAL/OSVersionInfoClass.cs",
"chars": 49084,
"preview": "using Microsoft.Win32;\nusing System;\nusing System.Diagnostics;\nusing System.Runtime.InteropServices;\n\n// http://www.cod"
},
{
"path": "CMWTAT_DIGITAL/Properties/AssemblyInfo.cs",
"chars": 1727,
"preview": "using System.Reflection;\nusing System.Resources;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropSer"
},
{
"path": "CMWTAT_DIGITAL/Properties/Resources.Designer.cs",
"chars": 3411,
"preview": "//------------------------------------------------------------------------------\n// <auto-generated>\n// 此代码由工具生成。\n/"
},
{
"path": "CMWTAT_DIGITAL/Properties/Resources.resx",
"chars": 6503,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n <!-- \n Microsoft ResX Schema \n \n Version 2.0\n \n The prim"
},
{
"path": "CMWTAT_DIGITAL/Properties/Settings.Designer.cs",
"chars": 981,
"preview": "//------------------------------------------------------------------------------\n// <auto-generated>\n// 此代码由工具生成。\n/"
},
{
"path": "CMWTAT_DIGITAL/Properties/Settings.settings",
"chars": 193,
"preview": "<?xml version='1.0' encoding='utf-8'?>\n<SettingsFile xmlns=\"uri:settings\" CurrentProfile=\"(Default)\">\n <Profiles>\n "
},
{
"path": "CMWTAT_DIGITAL/app.config",
"chars": 160,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n<startup><supportedRuntime version=\"v4.0\" sku=\".NETFramework,Vers"
},
{
"path": "CMWTAT_DIGITAL/app.manifest",
"chars": 2545,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<assembly manifestVersion=\"1.0\" xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n <ass"
},
{
"path": "CMWTAT_DIGITAL/packages.config",
"chars": 497,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n <package id=\"Costura.Fody\" version=\"4.1.0\" targetFramework=\"net452\""
},
{
"path": "CMWTAT_DIGITAL.sln",
"chars": 1114,
"preview": "\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 15\nVisualStudioVersion = 15.0.27130.2036\nM"
},
{
"path": "DirectRun.ps1",
"chars": 730,
"preview": "$isAdmin = (New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole"
},
{
"path": "LICENSE",
"chars": 18033,
"preview": "GNU GENERAL PUBLIC LICENSE\n\nCopyright (c) 2018 TGSAN\n\n Version 2, June 1991\n\n Copyright (C) 1989, "
},
{
"path": "README.en.md",
"chars": 4020,
"preview": "# Official Site\n\n[https://cmwtat.cloudmoe.com]\n\n# CloudMoe Windows 10+ Activation Toolkit Digital Edition\n\nThis toolkit "
},
{
"path": "README.md",
"chars": 837,
"preview": "# Official Site 官方网站\n\n[https://cmwtat.cloudmoe.com]\n\n# CloudMoe Windows 10+ Activation Toolkit Digital Edition\n\nThis too"
},
{
"path": "README.zh.md",
"chars": 2386,
"preview": "# 官方网站\n\n[https://cmwtat.cloudmoe.com]\n\n# 云萌 Windows 10+ 数字权利激活工具\n\n此工具可以使用数字权利激活您的 `Windows 10` 和 `Windows 11`。 \n\n一款使用`C"
},
{
"path": "_config.yml",
"chars": 583,
"preview": "theme: jekyll-theme-cayman\nshow_downloads: false\ntitle: CloudMoe Windows 10 Toolkit Digital Edition\ndescription: CloudM"
}
]
About this extraction
This page contains the full source code of the TGSAN/CMWTAT_Digital_Edition GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 34 files (242.7 KB), approximately 56.9k tokens, and a symbol index with 71 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.