using SkullLabs; using System; using System.Drawing; using System.Windows.Forms; namespace SkullLabsAuthExample { public class Form2 : Form { public Form2(LoginResult session, string licenseKey) { Text = "Skull Labs Auth - Activated"; Size = new Size(440, 280); StartPosition = FormStartPosition.CenterScreen; FormBorderStyle = FormBorderStyle.FixedDialog; MaximizeBox = false; BackColor = Color.FromArgb(12, 13, 17); ForeColor = Color.FromArgb(230, 232, 238); Font = new Font("Segoe UI", 9.5f); var title = new Label { Text = "LICENSE ACTIVE", Font = new Font("Consolas", 10f, FontStyle.Bold), ForeColor = Color.FromArgb(34, 211, 154), Location = new Point(24, 24), Size = new Size(380, 20), }; var keyLine = new Label { Text = $"Key: {licenseKey ?? "-"}", Font = new Font("Consolas", 11f), ForeColor = Color.White, Location = new Point(24, 50), Size = new Size(380, 22), }; string validityText; if (session.License?.ExpiresAt.HasValue == true) { var local = DateTimeOffset.FromUnixTimeMilliseconds(session.License.ExpiresAt.Value).LocalDateTime; validityText = $"Valid until: {local:dd MMM yyyy, HH:mm}"; } else { validityText = "Valid until: lifetime"; } var validity = new Label { Text = validityText, Font = new Font("Consolas", 10f), ForeColor = Color.FromArgb(0, 229, 255), Location = new Point(24, 78), Size = new Size(380, 22), }; string usesText; if (session.License != null) { usesText = session.License.MaxUses == 0 ? $"Uses: {session.License.Uses} / unlimited" : $"Uses: {session.License.Uses} / {session.License.MaxUses}"; } else { usesText = "Uses: -"; } var uses = new Label { Text = usesText, Font = new Font("Consolas", 10f), ForeColor = Color.FromArgb(139, 143, 156), Location = new Point(24, 104), Size = new Size(380, 20), }; var sessionLbl = new Label { Text = $"Session: {session.SessionId ?? "-"}", Font = new Font("Consolas", 8.5f), ForeColor = Color.FromArgb(139, 143, 156), Location = new Point(24, 128), Size = new Size(380, 20), }; var closeBtn = new Button { Text = "Close", Location = new Point(24, 176), Size = new Size(380, 32), BackColor = Color.FromArgb(20, 22, 28), ForeColor = Color.White, FlatStyle = FlatStyle.Flat, }; closeBtn.FlatAppearance.BorderColor = Color.FromArgb(40, 44, 56); closeBtn.Click += (s, e) => Close(); Controls.AddRange(new Control[] { title, keyLine, validity, uses, sessionLbl, closeBtn }); } } }