Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using BetterSocks;
- using Newtonsoft.Json;
- namespace BS_Console_Application_Example
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.Title = "Immense Console App Example";
- Seal.Authenticate("bKWNO1Inq0T7ZRkR02sR2JCRDbgrmOXxyUknV3Lm4Fu3x");
- Console.WriteLine("Welcome to Whatever V1");
- Console.Write("Login or Register: ");
- string option;
- option = Console.ReadLine();
- if (option == "Login")
- {
- Console.WriteLine("Please Login");
- string username, password = string.Empty;
- Console.Write("Username: ");
- if (Properties.Settings.Default.Username == "")
- {
- username = Console.ReadLine();
- }
- else
- {
- username = Properties.Settings.Default.Username;
- }
- Console.Write("Password: ");
- if (Properties.Settings.Default.Password == "")
- {
- password = Console.ReadLine();
- }
- else
- {
- password = Properties.Settings.Default.Password;
- }
- LoginResponse login = Seal.Login(username, password);
- if (login.status)
- {
- Console.WriteLine(string.Format("Username: {0} has logged in!", username));
- Console.Write("Remember Username and Password? (Yes/No): ");
- string rememberopt;
- rememberopt = Console.ReadLine();
- if (rememberopt == "Yes")
- {
- Properties.Settings.Default.Username = username;
- Properties.Settings.Default.Password = password;
- Properties.Settings.Default.Save();
- Console.WriteLine("User Settings Saved");
- }
- }
- else
- {
- Console.WriteLine("Login information is incorrect!");
- }
- }
- else if (option == "Register")
- {
- Console.WriteLine("Please Register");
- string username, password = string.Empty, token;
- Console.Write("Username: ");
- username = Console.ReadLine();
- Console.Write("Password: ");
- password = Console.ReadLine();
- Console.Write("Token: ");
- token = Console.ReadLine();
- RegisterResponse register = Seal.Register(username, password, token);
- if (register.status)
- {
- Console.WriteLine(string.Format("Username {0} has successfully registered!", username));
- }
- else
- {
- Console.WriteLine("Couldn't register user!");
- }
- }
- Console.Clear();
- Main(args);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement