-
Notifications
You must be signed in to change notification settings - Fork 1
/
Main.cs
108 lines (68 loc) · 2.13 KB
/
Main.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
106
107
108
using DevExpress.Utils.Extensions;
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Threading;
using System.Windows.Forms;
namespace KeyAuth
{
public partial class Main : Form
{
public Main()
{
InitializeComponent();
}
private void siticoneControlBox1_Click(object sender, EventArgs e)
{
Environment.Exit(0);
}
private void Main_Load(object sender, EventArgs e)
{
Login.KeyAuthApp.check();
var onlineUsers = Login.KeyAuthApp.fetchOnline();
foreach (var user in onlineUsers)
{
}
}
public static bool SubExist(string name, int len)
{
for (var i = 0; i < len; i++)
{
if (Login.KeyAuthApp.user_data.subscriptions[i].subscription == name)
{
return true;
}
}
return false;
}
public string expirydaysleft()
{
System.DateTime dtDateTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, System.DateTimeKind.Local);
dtDateTime = dtDateTime.AddSeconds(long.Parse(Login.KeyAuthApp.user_data.subscriptions[0].expiry)).ToLocalTime();
TimeSpan difference = dtDateTime - DateTime.Now;
return Convert.ToString(difference.Days + " Days " + difference.Hours + " Hours Left");
}
public DateTime UnixTimeToDateTime(long unixtime)
{
System.DateTime dtDateTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, System.DateTimeKind.Local);
try
{
dtDateTime = dtDateTime.AddSeconds(unixtime).ToLocalTime();
}
catch
{
dtDateTime = DateTime.MaxValue;
}
return dtDateTime;
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
{
}
}
private void button1_Click(object sender, EventArgs e)
{
}
}
}