64 lines
2.4 KiB
C#
64 lines
2.4 KiB
C#
using System;
|
||
using System.Collections.Generic;
|
||
using System.ComponentModel;
|
||
using System.Data;
|
||
using System.Drawing;
|
||
using System.Linq;
|
||
using System.Text;
|
||
using System.Threading.Tasks;
|
||
using System.Windows.Forms;
|
||
|
||
namespace StacjaProb
|
||
{
|
||
public partial class ProductKeyForm : Form
|
||
{
|
||
public ProductKeyForm()
|
||
{
|
||
InitializeComponent();
|
||
}
|
||
|
||
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||
{
|
||
System.Diagnostics.Process proc = new System.Diagnostics.Process();
|
||
proc.StartInfo.FileName = "mailto:info@softspm.com?subject=SoftSPM[Stacja Prób] - Klucz produktu&body=Klucz produktu dla "+ vGlobal.softwareLicencePart001 +" "+ vGlobal.softwareLicencePart002;
|
||
proc.Start();
|
||
}
|
||
|
||
private void textBoxProductKey_TextChanged(object sender, EventArgs e)
|
||
{
|
||
//textBoxProductKey.Text = textBoxProductKey.Text.ToUpper();
|
||
textBoxProductKey.CharacterCasing = CharacterCasing.Upper;
|
||
|
||
}
|
||
|
||
private void buttonSave_Click(object sender, EventArgs e)
|
||
{
|
||
if (textBoxProductKey.Text == vGlobal.softwareProductKey)
|
||
{
|
||
vGlobal.softwareProductKeyIsOK = true;
|
||
string userRoot = "HKEY_CURRENT_USER\\SoftSPM";
|
||
Microsoft.Win32.Registry.SetValue(userRoot, "PRODUCT_KEY", textBoxProductKey.Text);
|
||
MessageBox.Show("Dziękujemy za zakup produktu SoftSPM – Stacja Prób.\n\n"+ vGlobal.softwareLicenceFull);
|
||
this.Close();
|
||
}
|
||
else
|
||
{
|
||
if (MessageBox.Show("UWAGA!\nWprowadzony klucz produktu jest niepoprawny.\nCzy chcesz korzystać z wersji nielicencjonowanej – brak możliwości prowadzenia prób?", "Weryfikacja klucza produktu", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
|
||
{
|
||
vGlobal.softwareProductKeyIsOK = false;
|
||
vGlobal.softwareLicenceFull = "BRAK LICENCJI – skontaktuj się z autorem systemu: info@softspm.com";
|
||
vGlobal.softwareLicencePart001 = "BRAK LICENCJI";
|
||
vGlobal.softwareLicencePart001 = "BRAK LICENCJI";
|
||
this.Close();
|
||
}
|
||
}
|
||
|
||
}
|
||
|
||
private void ProductKeyForm_Load(object sender, EventArgs e)
|
||
{
|
||
|
||
}
|
||
}
|
||
}
|