C#: using Cbox for XRPTipBot (async and await)



Well, here is the code I promised to release. Learn how to use Cbox for your XRPTipBot. Basically, you can use Cbox to create live logs not only for XRPTipBot, but also other applications. Just create your Cbox account and change the following details:

boxid=000000&boxtag=XxXxXx

Read more about: Asynchronous programming with async and await (C#)

You can use Fiddler or WireShark to get”Request Headers” and “Response Headers” and other important details:

1
GET /box/?boxid=0000000&boxtag=XXXXXX&sec=css&theme=10&v=1541070807 HTTP/1.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
 var param = new Dictionary<string, string>
{
{ "nme", "parisbydavid" },
{ "pst", nme.Text + " +" + user.Text + " @xrptipbot" + " " + pst.Text }
};
using (var client = new HttpClient())
{
try
{

var content = new FormUrlEncodedContent(param);

var res = await client.PostAsync("https://www2.cbox.ws/box/?boxid=000000&boxtag=XxXxXx&sec=submit", content);

var responseString = await res.Content.ReadAsStringAsync();
}
catch (HttpRequestException)
{
}