Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2018
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.27 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using BetterSocks;
  7. using Newtonsoft.Json;
  8.  
  9. namespace BS_Console_Application_Example
  10. {
  11.     class Program
  12.     {
  13.         static void Main(string[] args)
  14.         {
  15.             Console.Title = "Immense Console App Example";
  16.             Seal.Authenticate("bKWNO1Inq0T7ZRkR02sR2JCRDbgrmOXxyUknV3Lm4Fu3x");
  17.             Console.WriteLine("Welcome to Whatever V1");
  18.             Console.Write("Login or Register: ");
  19.             string option;
  20.             option = Console.ReadLine();
  21.             if (option == "Login")
  22.             {
  23.                 Console.WriteLine("Please Login");
  24.                 string username, password = string.Empty;
  25.                 Console.Write("Username: ");
  26.                 if (Properties.Settings.Default.Username == "")
  27.                 {
  28.                     username = Console.ReadLine();
  29.                 }
  30.                 else
  31.                 {
  32.                     username = Properties.Settings.Default.Username;
  33.                 }
  34.                 Console.Write("Password: ");
  35.                 if (Properties.Settings.Default.Password == "")
  36.                 {
  37.                     password = Console.ReadLine();
  38.                 }
  39.                 else
  40.                 {
  41.                     password = Properties.Settings.Default.Password;
  42.                 }
  43.                 LoginResponse login = Seal.Login(username, password);
  44.                 if (login.status)
  45.                 {
  46.                     Console.WriteLine(string.Format("Username: {0} has logged in!", username));
  47.                     Console.Write("Remember Username and Password? (Yes/No): ");
  48.                     string rememberopt;
  49.                     rememberopt = Console.ReadLine();
  50.                     if (rememberopt == "Yes")
  51.                     {                    
  52.                         Properties.Settings.Default.Username = username;
  53.                         Properties.Settings.Default.Password = password;
  54.                         Properties.Settings.Default.Save();
  55.                         Console.WriteLine("User Settings Saved");
  56.                     }
  57.                 }
  58.                 else
  59.                 {
  60.                     Console.WriteLine("Login information is incorrect!");
  61.                 }
  62.             }
  63.             else if (option == "Register")
  64.             {          
  65.                 Console.WriteLine("Please Register");
  66.                 string username, password = string.Empty, token;
  67.                 Console.Write("Username: ");
  68.                 username = Console.ReadLine();
  69.                 Console.Write("Password: ");
  70.                 password = Console.ReadLine();
  71.                 Console.Write("Token: ");
  72.                 token = Console.ReadLine();
  73.                 RegisterResponse register = Seal.Register(username, password, token);
  74.                 if (register.status)
  75.                 {
  76.                     Console.WriteLine(string.Format("Username {0} has successfully registered!", username));
  77.                 }
  78.                 else
  79.                 {
  80.                     Console.WriteLine("Couldn't register user!");
  81.                 }
  82.             }
  83.             Console.Clear();
  84.             Main(args);
  85.         }
  86.     }
  87. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement