Exemple #1
0
        public override bool InternalSendTip(string User, decimal amount)
        {
            string s1  = Client.GetStringAsync("ajax.php?a=get_csrf").Result;
            MDCsrf tmp = json.JsonDeserialize <MDCsrf>(s1);
            List <KeyValuePair <string, string> > pairs = new List <KeyValuePair <string, string> >();

            pairs.Add(new KeyValuePair <string, string>("a", "tip_user"));
            pairs.Add(new KeyValuePair <string, string>("user_id", User));
            pairs.Add(new KeyValuePair <string, string>("amount", amount.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)));
            pairs.Add(new KeyValuePair <string, string>("csrf", tmp.csrf));


            FormUrlEncodedContent Content = new FormUrlEncodedContent(pairs);

            try
            {
                string sEmitResponse = Client.PostAsync("ajax.php", Content).Result.Content.ReadAsStringAsync().Result;
            }
            catch (AggregateException e)
            {
                Parent.DumpLog(e.InnerException.Message, 3);
                Parent.DumpLog(e.InnerException.StackTrace, 4);
            }
            return(false);
        }
Exemple #2
0
        protected override bool internalWithdraw(decimal Amount, string Address)
        {
            string s1  = Client.GetStringAsync("ajax.php?a=get_csrf").Result;
            MDCsrf tmp = json.JsonDeserialize <MDCsrf>(s1);

            List <KeyValuePair <string, string> > pairs = new List <KeyValuePair <string, string> >();

            pairs.Add(new KeyValuePair <string, string>("a", "withdraw"));
            pairs.Add(new KeyValuePair <string, string>("address", Address));
            pairs.Add(new KeyValuePair <string, string>("amount", Amount.ToString()));
            pairs.Add(new KeyValuePair <string, string>("csrf", csrf));


            FormUrlEncodedContent Content = new FormUrlEncodedContent(pairs);

            try
            {
                string sEmitResponse = Client.PostAsync("ajax.php", Content).Result.Content.ReadAsStringAsync().Result;
                return(true);
            }
            catch (AggregateException e)
            {
                Parent.DumpLog(e.InnerException.Message, 3);
                Parent.DumpLog(e.InnerException.StackTrace, 4);
                return(false);
            }
        }