Win32Exception“系统找不到指定的文件”

时间:2017-06-15 17:11:42

标签: vb.net wrapper

我正在尝试为monero挖掘创建一个用于xmrig的GUI /包装器,以便人们更容易拾取。我正在尝试将其设置为在GUI内的文本框内输出。使用此代码,我在miner.start()中不断收到Win32Exception,说该程序无法找到该文件。 xmrig32已经在bin / debug中的文件夹xmrig中。我试图解决这个问题,但我一直在解决这个问题。任何帮助将不胜感激。

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Dim pool = txtpool.Text()
    Dim wallet = txtwallet.Text()
    Dim threads = txtthreads.Text()

    txthidden.Text = "xmrig\xmrig32.exe" + " -o " + txtpool.Text + " -u " + txtwallet.Text + " -p x -k -t " + txtthreads.Text

    'Kill previous process attempt
    Try
        miner.Kill()
    Catch ex As Exception
    End Try

    'setup:
    txtoutput.Clear() 'clear previous outputs
    pso = New ProcessStartInfo(txthidden.Text$)

    'miner output code:
    Dim minerencoding As System.Text.Encoding
    System.Text.Encoding.GetEncoding(Globalization.CultureInfo.CurrentUICulture.TextInfo.OEMCodePage)
    With pso
        .UseShellExecute = False
        .RedirectStandardError = True
        .RedirectStandardOutput = True
        .RedirectStandardInput = True
        .CreateNoWindow = True
        .StandardOutputEncoding = minerencoding
        .StandardErrorEncoding = minerencoding
    End With
    miner = New Process With {.StartInfo = pso, .EnableRaisingEvents = True}
    AddHandler miner.ErrorDataReceived, AddressOf Bsync_Data_Received
    AddHandler miner.OutputDataReceived, AddressOf Bsync_Data_Received
    miner.Start()
    miner.BeginOutputReadLine()
    miner.BeginErrorReadLine()


End Sub

Private Sub Bsync_Data_Received(ByVal sender As Object, ByVal e As DataReceivedEventArgs)
    Me.Invoke(New InvokeWithString(AddressOf Sync_OutputMiner), e.Data)
End Sub

Private Sub Sync_OutputMiner(ByVal text2 As String)
    txtoutput.AppendText(text2 & Environment.NewLine)
    txtoutput.ScrollToCaret()
End Sub

0 个答案:

没有答案