Private Sub BackgroundWorker1_DoWork(sender As Object, e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork ' ========================================================== ' This function will call the initial bat file ("runminer") ' to run the miner bat ("runbat") ' path == \configs\cpuminer-x64 ' ==========================================================
Dim proc As Process = Nothing
Try
Dim batdir As String = String.Format(startpath & "\configs\cpuminer-x64")
proc = New Process()
proc.StartInfo.WorkingDirectory = batdir
proc.StartInfo.FileName = "runminer.bat"
proc.StartInfo.CreateNoWindow = False
proc.Start()
Dim oStreamReader As StreamReader = proc.StandardOutput
Dim notif As New System.Windows.Forms.NotifyIcon()
While True
oStreamReader.ReadLine()
If oStreamReader.ReadLine.Contains("scrypt") Then
notif.Visible = True
notif.Icon = System.Drawing.SystemIcons.Information
notif.BalloonTipTitle = "Information"
notif.BalloonTipText = "Yaaay a block share was accepted!" + Environment.NewLine + "Happy farming!"
End If
End While
notif.ShowBalloonTip(5000)
Thread.Sleep(10000)
notif.Dispose()
Catch ex As Exception
Console.WriteLine(ex.StackTrace.ToString())
End Try
End Sub