public string get_coin(string coin_name, ExpertViewMode frm) { using (WebClient wc = new WebClient()) { string json = wc.DownloadString("https://api.bithumb.com/public/ticker/" + coin_name); JObject coin_json = JObject.Parse(json); frm.a1.Text = String.Format("{0:#,###}", Convert.ToInt32(coin_json["data"]["min_price"].ToString())) + " won"; frm.a2.Text = String.Format("{0:#,###}", Convert.ToInt32(coin_json["data"]["max_price"].ToString())) + " won"; frm.a3.Text = String.Format("{0:#,###.##}", (Convert.ToDouble(coin_json["data"]["min_price"].ToString()) + Convert.ToDouble(coin_json["data"]["max_price"].ToString())) / 2) + " won"; //frm.a4.Text = String.Format("{0:#,###}", Convert.ToInt32(coin_json["data"]["24H_fluctate"].ToString())) + " won"; return(coin_json["data"]["date"].ToString()); } }
public void get_coin(string coin_name, ExpertViewMode frm) { using (WebClient wc = new WebClient()) { string json = wc.DownloadString("https://api.bithumb.com/public/ticker/" + coin_name); JObject coin_json = JObject.Parse(json); frm.m1.Text = String.Format("{0:#,###}", Convert.ToInt32(coin_json["data"]["min_price"].ToString())) + " won"; frm.m2.Text = String.Format("{0:#,###}", Convert.ToInt32(coin_json["data"]["max_price"].ToString())) + " won"; frm.m3.Text = String.Format("{0:#,###.##}", (Convert.ToDouble(coin_json["data"]["min_price"].ToString()) + Convert.ToDouble(coin_json["data"]["max_price"].ToString())) / 2) + " won"; //frm.m4.Text = String.Format("{0:#,###}", Convert.ToInt32(coin_json["data"]["24H_fluctate"].ToString())) + " won"; frm.m6.Text = String.Format("{0:#,###}", Convert.ToInt32(coin_json["data"]["opening_price"].ToString())) + " won"; frm.m7.Text = String.Format("{0:#,###}", Convert.ToInt32(coin_json["data"]["closing_price"].ToString())) + " won"; //frm.m8.Text = String.Format("{0:#,###}", Convert.ToInt32(coin_json["data"]["buy_price"].ToString())) + " won"; //frm.m9.Text = String.Format("{0:#,###}", Convert.ToInt32(coin_json["data"]["sell_price"].ToString())) + " won"; //return coin_json["data"]["date"].ToString(); } }