This commit is contained in:
sc authored and sc committed 2024-03-29 15:26:52 +08:00
commit 3d553d1eed
3 files changed
+89 -1

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
<Window x:Class="formula_manage.Windows.CDKEY"
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:local="clr-namespace:formula_manage.Windows"
mc:Ignorable="d" Loaded="Window_CDKEY" BorderBrush="White" Background="#FFEFEFEF"
Title="CDKEY" Height="140" Width="500" MaxHeight="140" MaxWidth="500" ResizeMode="NoResize">
<Grid>
<TextBlock HorizontalAlignment="Left" Height="20" Margin="20,35,0,0" TextWrapping="Wrap" Text="CDKEY:" VerticalAlignment="Top" Width="70" FontSize="16"/>
<TextBlock HorizontalAlignment="Left" Height="20" Margin="20,10,0,0" TextWrapping="Wrap" Text="SN:" VerticalAlignment="Top" Width="70" FontSize="16"/>
<TextBox x:Name="sn_id" HorizontalAlignment="Left" Height="20" Margin="90,10,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="360" Background="#FFE6E6E6" IsReadOnly="True"/>
<TextBox x:Name="cdk" HorizontalAlignment="Left" Height="20" Margin="90,35,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="360"/>
<Button Content="OK" HorizontalAlignment="Right" Height="20" Margin="0,60,50,0" VerticalAlignment="Top" Width="85" Background="#FFE6E6E6" Click="Button_Click_2"/>
</Grid>
</Window>
+64
View File
@@ -0,0 +1,64 @@
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Forms;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace formula_manage.Windows
{
/// <summary>
/// CDKEY.xaml 的交互逻辑
/// </summary>
public partial class CDKEY : Window
{
public CDKEY()
{
WindowStartupLocation = WindowStartupLocation.CenterScreen;
InitializeComponent();
}
bool SQLTIME;
int Time;
int i;
string SQLIP;
string SQLNAME;
bool SQLMOD;
string SQLUSER;
string SQLPASS;
public string INIPath = Convert.ToString(System.AppDomain.CurrentDomain.BaseDirectory) + "formula.ini";
private void Window_CDKEY(object sender, RoutedEventArgs e) //打开页面
{
UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(INIPath); //读配置文件
SQLIP = Configini.IniReadvalue("SQL_SERVER", "SQL1"); //读配置文件
SQLNAME = Configini.IniReadvalue("SQL_SERVER", "SQL2");
int.TryParse(Configini.IniReadvalue("SQL_SERVER", "SQL3"), out i); //读数据库状态配置文件
if (i == 0) SQLMOD = false;
else SQLMOD = true;
SQLUSER = Configini.IniReadvalue("SQL_SERVER", "SQL4");
SQLPASS = Configini.IniReadvalue("SQL_SERVER", "SQL5");
}
private async void Button_Click_2(object sender, RoutedEventArgs e)
{
}
}
}