Esempio n. 1
0
File: PD.cs Progetto: 147863/DiceBot
        public string getDepositAddress()
        {
            try
            {
                 string sEmitResponse = Client.GetStringAsync("deposit?api_key=" + accesstoken).Result;
                pdDeposit tmpa = json.JsonDeserialize<pdDeposit>(sEmitResponse);
                return tmpa.address;
            }
            catch (WebException e)
            {
                if (e.Response != null)
                {

                    string sEmitResponse = new StreamReader(e.Response.GetResponseStream()).ReadToEnd();
                    Parent.updateStatus(sEmitResponse);
                    if (e.Message.Contains("429"))
                    {
                        Thread.Sleep(1500);
                        return getDepositAddress();
                    }
                    
                }
                return "";
            }
        }
Esempio n. 2
0
        public string getDepositAddress()
        {
            try
            {
                HttpWebRequest betrequest = (HttpWebRequest)HttpWebRequest.Create("https://api.primedice.com/api/deposit?access_token=" + accesstoken);
                if (Prox != null)
                {
                    betrequest.Proxy = Prox;
                }
                betrequest.Method = "GET";
                string post = string.Format("seed={0}", Guid.NewGuid().ToString().Replace("-", "").Substring(0, 20));

                betrequest.ContentType = "application/x-www-form-urlencoded; charset=UTF-8";


                HttpWebResponse EmitResponse  = (HttpWebResponse)betrequest.GetResponse();
                string          sEmitResponse = new StreamReader(EmitResponse.GetResponseStream()).ReadToEnd();
                pdDeposit       tmpa          = json.JsonDeserialize <pdDeposit>(sEmitResponse);
                return(tmpa.address);
            }
            catch (WebException e)
            {
                if (e.Response != null)
                {
                    string sEmitResponse = new StreamReader(e.Response.GetResponseStream()).ReadToEnd();
                    Parent.updateStatus(sEmitResponse);
                    if (e.Message.Contains("429"))
                    {
                        Thread.Sleep(1500);
                        return(getDepositAddress());
                    }
                }
                return("");
            }
        }