Browse Source

CDKET生成

master
sc 2 years ago
parent
commit
481d85d04a
  1. 0
      CRCcheck16.cs
  2. BIN
      Logo/SUNLIGHT.ico
  3. BIN
      Logo/sunlight_logo.ico
  4. BIN
      Logo/sunlight_logo.jpg
  5. BIN
      Logo/sunlight_logotext.jpg
  6. BIN
      Logo/sunlight_sc.png
  7. 2
      MainWindow.xaml
  8. 15
      MainWindow.xaml.cs
  9. 8
      SUNLIGHT_CDKEY.csproj
  10. BIN
      sunlight_logo.ico

0
UserClass/CRCcheck16.cs → CRCcheck16.cs

BIN
Logo/SUNLIGHT.ico

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
Logo/sunlight_logo.ico

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
Logo/sunlight_logo.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

BIN
Logo/sunlight_logotext.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 KiB

BIN
Logo/sunlight_sc.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

2
MainWindow.xaml

@ -5,7 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:SUNLIGHT_CDKEY" xmlns:local="clr-namespace:SUNLIGHT_CDKEY"
mc:Ignorable="d" mc:Ignorable="d"
Title="MainWindow" Height="400" Width="600"> Title="SUNLIGHT_CDKEY" Height="400" Width="600">
<Grid> <Grid>
<TextBlock HorizontalAlignment="Left" Height="40" Margin="20,10,0,0" TextWrapping="Wrap" Text="SN:" VerticalAlignment="Top" Width="170" FontSize="24"/> <TextBlock HorizontalAlignment="Left" Height="40" Margin="20,10,0,0" TextWrapping="Wrap" Text="SN:" VerticalAlignment="Top" Width="170" FontSize="24"/>
<TextBox x:Name="sn_id" HorizontalAlignment="Left" Height="40" Margin="170,10,0,0" VerticalAlignment="Top" Width="340" FontSize="24"/> <TextBox x:Name="sn_id" HorizontalAlignment="Left" Height="40" Margin="170,10,0,0" VerticalAlignment="Top" Width="340" FontSize="24"/>

15
MainWindow.xaml.cs

@ -1,4 +1,5 @@
using System; using formula_manage.UserClass;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
@ -12,7 +13,6 @@ using System.Windows.Media;
using System.Windows.Media.Imaging; using System.Windows.Media.Imaging;
using System.Windows.Navigation; using System.Windows.Navigation;
using System.Windows.Shapes; using System.Windows.Shapes;
using SUNLIGHT_CDKEY.UserClass;
namespace SUNLIGHT_CDKEY namespace SUNLIGHT_CDKEY
{ {
@ -105,10 +105,17 @@ namespace SUNLIGHT_CDKEY
private void Button_Click(object sender, RoutedEventArgs e) private void Button_Click(object sender, RoutedEventArgs e)
{ {
string a, b; string a;
string b, my, mm, md;
if (sn_id.Text == "") return;
a= sn_id.Text.Substring(0, 6); a= sn_id.Text.Substring(0, 6);
b=(2255-y).ToString()+(255-m).ToString()+(255-d).ToString();
my = Convert.ToString(Convert.ToInt32(2255 - y), 16).ToUpper();
mm = Convert.ToString(Convert.ToInt32(255 - m), 16).ToUpper();
md = Convert.ToString(Convert.ToInt32(255-d), 16).ToUpper();
b=my+mm+md;
cdk.Text = a + b + CRCcheck16.ToCRC16(CRCcheck16.StringToHexByte(b), true); cdk.Text = a + b + CRCcheck16.ToCRC16(CRCcheck16.StringToHexByte(b), true);
} }

8
SUNLIGHT_CDKEY.csproj

@ -33,6 +33,9 @@
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<PropertyGroup>
<ApplicationIcon>sunlight_logo.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
@ -66,7 +69,7 @@
<Compile Include="Properties\AssemblyInfo.cs"> <Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType> <SubType>Code</SubType>
</Compile> </Compile>
<Compile Include="UserClass\CRCcheck16.cs" /> <Compile Include="CRCcheck16.cs" />
<Compile Include="Properties\Resources.Designer.cs"> <Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen> <AutoGen>True</AutoGen>
<DesignTime>True</DesignTime> <DesignTime>True</DesignTime>
@ -86,5 +89,8 @@
<LastGenOutput>Settings.Designer.cs</LastGenOutput> <LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None> </None>
</ItemGroup> </ItemGroup>
<ItemGroup>
<Resource Include="sunlight_logo.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project> </Project>

BIN
sunlight_logo.ico

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Loading…
Cancel
Save