Bitcoin Forum
May 01, 2024, 06:19:32 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Adding BTC value in vb.net windows form applications  (Read 121 times)
Karim12 (OP)
Newbie
*
Offline Offline

Activity: 5
Merit: 0


View Profile
May 28, 2018, 01:59:40 AM
 #1

Hello guys, Is it possible to show the BTC value in a button or textbox in vb.net windows form application? I need it so bad.
Thanks
1714587572
Hero Member
*
Offline Offline

Posts: 1714587572

View Profile Personal Message (Offline)

Ignore
1714587572
Reply with quote  #2

1714587572
Report to moderator
1714587572
Hero Member
*
Offline Offline

Posts: 1714587572

View Profile Personal Message (Offline)

Ignore
1714587572
Reply with quote  #2

1714587572
Report to moderator
"In a nutshell, the network works like a distributed timestamp server, stamping the first transaction to spend a coin. It takes advantage of the nature of information being easy to spread but hard to stifle." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714587572
Hero Member
*
Offline Offline

Posts: 1714587572

View Profile Personal Message (Offline)

Ignore
1714587572
Reply with quote  #2

1714587572
Report to moderator
1714587572
Hero Member
*
Offline Offline

Posts: 1714587572

View Profile Personal Message (Offline)

Ignore
1714587572
Reply with quote  #2

1714587572
Report to moderator
1714587572
Hero Member
*
Offline Offline

Posts: 1714587572

View Profile Personal Message (Offline)

Ignore
1714587572
Reply with quote  #2

1714587572
Report to moderator
NeuroticFish
Legendary
*
Offline Offline

Activity: 3654
Merit: 6371


Looking for campaign manager? Contact icopress!


View Profile
May 28, 2018, 05:33:08 AM
 #2

Hello guys, Is it possible to show the BTC value in a button or textbox in vb.net windows form application? I need it so bad.
Thanks


You have to make a http request to one of the exchanges, for example https://api.bitfinex.com/v1/pubticker/BTCUSD
Then you have to parse the response (json) and get the price (docs are here https://bitfinex.readme.io/v1/reference#rest-public-ticker)
Then you can set the text on the button.

Of course, you may have to refresh that value from time to time.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
TryNinja
Legendary
*
Offline Offline

Activity: 2814
Merit: 6974



View Profile WWW
May 28, 2018, 03:57:47 PM
 #3

A simple example:

1. Install Json.net with NuGet: https://www.newtonsoft.com/json;

2. Import it;
Code:
Imports Newtonsoft.Json.Linq

3. Use something like this:
Code:
Dim webClient As New System.Net.WebClient
Dim result As String = webClient.DownloadString("https://api.coinmarketcap.com/v2/ticker/1/?convert=BTC")

Dim json As JObject = JObject.Parse(result)
TextBox1.Text = "$" + json.SelectToken("data").SelectToken("quotes").SelectToken("USD").SelectToken("price").ToString()

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!