Esempio n. 1
0
        /// <summary>
        /// Enable/Diable user
        /// Hash MD5: HashEnableUser
        /// Amount: 3 params
        /// </summary>
        /// <param name="login"></param>
        /// <param name="pass"></param>
        /// <param name="TID"></param>
        /// <returns></returns>
        public string ApiEnableUser(string login, string TID)
        {
            string strMdD5 = hashMD5.HashEnableUser(login, TID);

            using (var client = new HttpClient())
            {
                client.BaseAddress = new Uri(URL_API_FUNDIST);
                client.DefaultRequestHeaders.Accept.Clear();
                client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json");
                HttpResponseMessage response = client.GetAsync("System/Api/" + API_KEY + "/User/Enable/?&Login="******"&TID=" + TID + "&Hash=" + strMdD5).Result;//có thể option reason
                if (response.IsSuccessStatusCode)
                {
                    return(response.Content.ReadAsStringAsync().Result);
                }
                return(null);
            }
        }