Exemplo n.º 1
0
        /// <summary>
        /// Log-in to Pastebin
        /// </summary>
        /// <returns>new User object</returns>
        public static User Login(string username, string password)
        {
            var result = Utills.PostRequest(Utills.URL_LOGIN,
                                            "api_dev_key=" + DevKey,
                                            "api_user_name=" + username,
                                            "api_user_password=" + password);

            if (result.Contains(Utills.ERROR))
                throw new PastebinException(result);

            var user = new User(result);
            user.RequestPreferences();
            return user;
        }