早教吧 育儿知识 作业答案 考试题库 百科 知识分享

VB的问题求解用VB编了一个很简单的计算器,比如2+2=4,请问用API的WriteProcessMemory怎么去修改内核,使得2+2=3或者5

题目详情
VB的问题 求解用VB编了一个很简单的计算器,比如2+2=4,请问用API的WriteProcessMemory怎么去修改内核,使得2+2=3或者5
▼优质解答
答案和解析
简易计算器程序: Dim shishu As Double Dim yi As Double Dim er As Double Dim fuhao As String ‘按件数组 Private Sub Command1_Click(Index As Integer) din = 0 ‘数字设置: Select Case Index Case 1 To 9 Text1.Text = Val(Text1.Text & Index) ‘ 零的设置: Case 0 If Val(Text1.Text) = 0 Then Text1.Text = Index Else Text1.Text = Val(Text1.Text & "0") End If 点号设置: Case 14 For i = 1 To Len(Text1.Text) If Mid(Text1.Text, i, 1) = "." Then din = 1 Next i If din = 1 Then Else Text1.Text = Text1.Text & "." End If 符号记录: Case 10 fuhao = "+" yi = Val(Text1.Text) Text1.Text = "" Command1(10).Enabled = False Command1(11).Enabled = False Command1(12).Enabled = False Command1(13).Enabled = False Case 11 fuhao = "-" yi = Val(Text1.Text) Text1.Text = "" Command1(10).Enabled = False Command1(11).Enabled = False Command1(12).Enabled = False Command1(13).Enabled = False Case 12 fuhao = "*" yi = Val(Text1.Text) Text1.Text = "" Command1(10).Enabled = False Command1(11).Enabled = False Command1(12).Enabled = False Command1(13).Enabled = False Case 13 fuhao = "/" yi = Val(Text1.Text) Text1.Text = "" Command1(10).Enabled = False Command1(11).Enabled = False Command1(12).Enabled = False Command1(13).Enabled = False End Select End Sub ‘进制函数: Private Function panda(ByVal sel As Single) As String Dim a As String Dim ms As String Do While sel 0 a = Str(sel Mod 2) sel = sel \ 2 ms = a & ms Loop panda = ms End Function