如何"添加"不是"覆盖"使用WriteDMAInteger的金额

时间:2017-05-14 15:36:21

标签: vb.net

我正在制作一个改变地址值的程序,但是我希望能够添加"添加"让我们说" 500"到当前地址。不要改变" 1500"至" 500"。我能以任何方式实现这一目标吗?

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    Dim ammount As String = TextBox1.Text
    Try
        WriteDMAInteger("Process.dat", GetModuleHandle("Process.dat", "Process.dat") + &H3B80F8, {&H790}, ammount, 1, 4)
    Catch ex As Exception
    End Try
End Sub

1 个答案:

答案 0 :(得分:0)

非常感谢@Visual Vincent推荐或提醒我使用"ReadDMAInteger"方法。使用"ReadDMAInteger"我能够读取地址的值并将其作为整数的值。从那里我可以简单地使用整数和即插即用。

当然,您可能希望使用此设置计时器。

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
            Try
                My.Computer.Audio.Play(My.Resources.Speech_Sleep, AudioPlayMode.Background)
                Dim ammount As String = TextBox1.Text

                Dim total1 As Integer
                Dim totalstring1 As Integer
                Dim final1 As Integer

                total1 = ReadDMAInteger("Process.dat", GetModuleHandle("Process.dat", "Process.dat") + &H3B80F8, {&H790}, 1)

                totalstring1 = TextBox1.Text.Trim
                final1 = (total1 + totalstring1)

                Try
                    WriteDMAInteger("Process", GetModuleHandle("Process.dat", "Process.dat") + &H3B80F8, {&H790}, final1, 1, 4)
                Catch ex As Exception
                End Try
            End If