示例#1
0
        /// <summary>
        /// New user creation
        /// Hash MD5: User/Add/[CASINO_SERVER_IP]/[TID]/[KEY]/[LOGIN]/[PASSWORD]/[CURRENCY]/[PWD]
        /// url: /System/Api/[KEY]/User/Add/?
        /// Amount Param: 20 params
        /// </summary>
        /// <param name="login"></param>
        /// <param name="pass"></param>
        /// <param name="TID"></param>
        /// <param name="regIP">kiểm tra IP của quốc gia đó có trong danh sách bị cấm của fundits</param>
        /// <param name="gender"></param>
        /// <param name="country"></param>
        /// <param name="dateOfBirth"></param>
        /// <param name="nick"></param>
        /// <param name="timezone">muối giờ</param>
        /// <param name="name"></param>
        /// <param name="lastName"></param>
        /// <param name="phone">sdt để đăng ký tài khoản</param>
        /// <param name="albPhone">sô điện thoại đẻ reset tài khoản</param>
        /// <param name="city"></param>
        /// <param name="address"></param>
        /// <param name="email"></param>
        /// <param name="AffiliateID">ID liên kết bên thứ 3</param>
        /// <returns></returns>
        public async System.Threading.Tasks.Task <string> ApiCreateUser(string login, string pass, string TID, string regIP, string nickName)
        {
            string strMdD5 = hashMD5.Fundist_Hash(login, pass, 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 = (await client.PostAsync("System/Api/" + API_KEY + "/User/Add/?&Login="******"&Password="******"&TID=" + TID + "&Currency=" + CURRENCY + "&Hash=" + strMdD5 + "&Language=" + LANGUAGE + "&Nick=" + nickName + "&RegistrationIP=" + regIP, null));
                if (response.IsSuccessStatusCode)
                {
                    return(response.Content.ReadAsStringAsync().Result);
                }
                return(null);
            }
        }