Пример #1
0
        private static void ProfileDetailsExample()
        {
            string userId     = "";
            string userSecret = "";

            var choice = AskFor <int>("Enter 1 to enter custom profile info, or 0 to use the last searched for info: ");

            if (choice == 1)
            {
                userId     = AskFor <string>("Enter a User Token to look for: ");
                userSecret = AskFor <string>("Enter a User Secret to look for: ");
            }
            else
            {
                userId     = searchUserKey;
                userSecret = searchUserSecret;
            }

            if (profileGet == null)
            {
                profileGet = new ProfileGet(consumerKey, consumerSecret);
            }

            var response = profileGet.GetResponseSynchronously(new ProfileGetRequest()
            {
                UserToken  = userId,
                UserSecret = userSecret
            });

            if (response != null && response.profile != null)
            {
                Console.WriteLine("Got Profile Details: ");
                ShowPropertyValues(response.profile);
            }
            else
            {
                Console.WriteLine("Problem getting profile.");
            }
        }