-
Notifications
You must be signed in to change notification settings - Fork 0
/
eauthLoginFormLK.cs
100 lines (87 loc) · 3.19 KB
/
eauthLoginFormLK.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
using System;
using System.Windows.Forms;
using Eauth;
namespace Eauth_CS_Winform
{
public partial class eauthLoginFormLK : Form
{
EauthPrimaryClass eauthClass = new EauthPrimaryClass(); // Creates a new instance of the "EauthPrimaryClass" class and assigns it to the "eauthClass" variable
public eauthLoginFormLK()
{
InitializeComponent();
}
private async void eauthLoginFormLK_Load(object sender, EventArgs e)
{
if (await eauthClass.InitRequest() == false)
{
MessageBox.Show(EauthPrimaryClass.errorMessage);
}
}
private void exitButton_Click(object sender, EventArgs e)
{
Environment.Exit(0);
}
private async void loginButton_Click(object sender, EventArgs e)
{
string licenseKey = licenseField1.Text + "-" + licenseField2.Text + "-" + licenseField3.Text + "-" + licenseField4.Text;
if (licenseKey.EndsWith("-"))
{
licenseKey = licenseKey.Remove(licenseKey.Length - 1);
}
loginButton.Enabled = false;
if (await eauthClass.LoginRequest("", "", licenseKey))
{
// Code block executed if credentials are valid:
MessageBox.Show(EauthPrimaryClass.loggedMessage
+ "\n " + "Rank: " + EauthPrimaryClass.userRank
+ "\n " + "Hardware-ID: " + EauthPrimaryClass.userHwid
+ "\n " + "Register Date: " + EauthPrimaryClass.registerDate
+ "\n " + "Expire Date: " + EauthPrimaryClass.expireDate);
// Download file
/*
if (await eauthClass.DownloadRequest("fileID", "./path", "name.format")) // (ex) name.format > name.exe
{
MessageBox.Show("The file has been successfully downloaded.");
}
else
{
MessageBox.Show(EauthPrimaryClass.errorMessage);
}
*/
}
else
{
MessageBox.Show(EauthPrimaryClass.errorMessage);
}
loginButton.Enabled = true;
}
private void loginNamePasswordButton_Click(object sender, EventArgs e)
{
// Create an instance of the new form
eauthLoginFormUP loginForm = new eauthLoginFormUP();
// Hide the current form
this.Hide();
// Show the new form
loginForm.ShowDialog();
// Close the current form
this.Close();
}
private void licenseField1_TextChanged(object sender, EventArgs e)
{
licenseField2.Text = "";
licenseField3.Text = "";
licenseField4.Text = "";
try
{
string[] parts = licenseField1.Text.Split('-');
licenseField1.Text = parts[0];
licenseField2.Text = parts[1];
licenseField3.Text = parts[2];
licenseField4.Text = parts[3];
}
catch
{
}
}
}
}