Пример #1
0
        static void Main(string[] args)
        {
            ApiHelper.InitializeClient();

            while (true)
            {
                Console.Clear();
                Console.Write("Enter username: "******"Enter password: "******"\n\n\n");
                    string  token       = ApiResponseHelper.GetToken(loginResult);
                    JObject tokenResult = ApiRequestHelper.GetResultWithToken(token);


                    if (!ApiResponseHelper.IsRequestSucceeded(tokenResult))
                    {
                        Console.WriteLine("Token not valid.");
                    }
                    else
                    {
                        Console.WriteLine($"\n\n======================LOGIN SUCCEEDED======================\n\n");
                        Console.WriteLine($"Username : {username}");
                        Console.WriteLine($"\nMESSAGE : {ApiResponseHelper.GetMessage(tokenResult)}");

                        Console.WriteLine("\n\nPress ENTER to continue...");
                    }
                }
                else
                {
                    Console.WriteLine("\n\nWrong username or password.");
                    Console.WriteLine("\nPress ENTER to try again...");
                }
                Console.ReadLine();
            }
        }