-
Notifications
You must be signed in to change notification settings - Fork 0
/
eauthLoginFormUP.cs
105 lines (87 loc) · 3.22 KB
/
eauthLoginFormUP.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
101
102
103
104
105
using System;
using System.Windows.Forms;
using Eauth;
namespace Eauth_CS_Winform
{
public partial class eauthLoginFormUP : Form
{
EauthPrimaryClass eauthClass = new EauthPrimaryClass(); // Creates a new instance of the "EauthPrimaryClass" class and assigns it to the "eauthClass" variable
public eauthLoginFormUP()
{
InitializeComponent();
}
private async void eauthLoginForm_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)
{
loginButton.Enabled = false;
if (await eauthClass.LoginRequest(nameInput.Text, passwordInput.Text, ""))
{
// 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 registerInsteadButton_Click(object sender, EventArgs e)
{
// Create an instance of the new form
eauthRegisterForm registerForm = new eauthRegisterForm();
// Hide the current form
this.Hide();
// Show the new form
registerForm.ShowDialog();
// Close the current form
this.Close();
}
private void loginNamePasswordButton_Click(object sender, EventArgs e)
{
// Create an instance of the new form
eauthLoginFormLK loginForm = new eauthLoginFormLK();
// Hide the current form
this.Hide();
// Show the new form
loginForm.ShowDialog();
// Close the current form
this.Close();
}
private void upgradeAccountButton_Click(object sender, EventArgs e)
{
// Create an instance of the new form
eauthUpgradeForm upgradeForm = new eauthUpgradeForm();
// Hide the current form
this.Hide();
// Show the new form
upgradeForm.ShowDialog();
// Close the current form
this.Close();
}
}
}