Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ' add a 2 txt box and a button. TxtAddress and Txtamount tell the button
- 'if u want to use litecoin, the API are the same u just change the folder location from bitcoin to litecoin
- 'and use the litecoinD as oppose to bitcoinD obviously :D
- 'ensure u have the daemon running and it will work if not the APIgrabber wil sense its not running and give
- ' you a nice message
- '_code below this line_
- Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- Dim Argumentz As String
- Argumentz = APIGrabber(InputBox("Input arguments"))
- 'this is just an example of manually typing in a API command
- MsgBox(Argumentz)
- End Sub
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- dim stringtext as string
- dim TransXID as string
- stringtext ="sendtoaddress " & txtAddress.text & " " & txtamount.text /
- TransXID=APIGrabber(stringtext)
- if TransXID <> "daemons not running fool" then
- msgbox("success")
- 'do what u like with the transaction id returned
- else
- msgbox("dumb fool done something wrong: " & transXID)
- endif
- End Sub
- Private Function APIGrabber(ByVal Argumentz As String) As String
- If Process.GetProcessesByName("bitcoind").Count > 0 Then
- Dim proc = New Process
- proc.StartInfo.Arguments = Argumentz
- proc.StartInfo.FileName = "C:\Program Files\Bitcoin\daemon\bitcoind.exe"
- proc.StartInfo.RedirectStandardOutput = True
- proc.StartInfo.UseShellExecute = False
- proc.StartInfo.CreateNoWindow = True
- proc.Start()
- proc.WaitForExit()
- Return proc.StandardOutput.ReadLine
- Else
- Return "daemons not running fool"
- End If
- End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement