[VB.NET]谁能把这个VB6的程序变成VB.NET?

前端之家收集整理的这篇文章主要介绍了[VB.NET]谁能把这个VB6的程序变成VB.NET?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
谁能把这个VB6的程序变成VB.NET? -----------------VB6.0------------------------ Public Declare Function ReadProcessMemory Lib kernel32.dll (ByVal hProcess As Long,ByVal lpBaseAddress As Long,ByRef lpBuffer As Any,ByVal nSize As Long,ByRef lpNumberOfBytesWritten As Long) As Long Dim h As Long ReadProcessMemory hProcess,ByVal &HAEBD90,h,4,0& 人血 ReadProcessMemory hProcess,ByVal h + &H20,0& ReadProcessMemory hProcess,ByVal h + &H250,0& Label1.Caption = h =================VB.NET======================== Public Declare Function ReadProcessMemory Lib kernel32 (ByVal hProcess As Integer,ByVal lpBaseAddress As IntPtr,ByVal lpBuffer As IntPtr,ByVal nSize As Integer,ByRef lpNumberOfBytesWritten As Integer) As Integer Dim h As Long ReadProcessMemory(hProcess,&HAEBD90,0) 人血 ReadProcessMemory(hProcess,h + 20,0) ReadProcessMemory(hProcess,h + 250,0) Label1.Text = h VB6.0的程序可以运行,而且得到的数据也是正确的,但是VB.NET的那个程序可以运行但是得到的数据却是“空白”,请大家帮忙修改一下啊 只剩这60分了。。。大家将就一下。。。 在线等,随时测试 __________________________________________________________________________ ByVal lpBaseAddress As IntPtr,ByVal lpBuffer As IntPtr 怎么是IntPtr?! __________________________________________________________________________ Public Declare Function ReadProcessMemory Lib kernel32 Alias ReadProcessMemory (ByVal hProcess As Integer,ByVal lpBaseAddress As Object,ByRef lpBuffer As Object,lpNumberOfBytesWritten As Integer) As Integer 看原声明,lpBaseAddressObject好象也应该用ByRef,问题不大 Object用string应该也可以! __________________________________________________________________________ Public Declare Function ReadProcessMemory Lib kernel32 (ByVal hProcess As Integer,ByVal lpBaseAddress As Integer,ByVal lpBuffer As Integer,ByRef lpNumberOfBytesWritten As Integer) As Integer Public Declare Function ReadProcessMemory Lib kernel32 (ByVal hProcess As Integer,ByVal lpBuffer() As Byte,ByRef lpNumberOfBytesWritten As Integer) As Integer 我用这两个也还是一样的结果啊。。。 __________________________________________________________________________ VB的long可存放的是从 -2147483648 到 2147483648,把一个比2147483648还大数从内存中读出来,然后再用一个新的数写回去该怎么做?,比如:2148550880 顶楼 -----------------VB6.0------------------------ Dim h As Long ReadProcessMemory hProcess,0& Label1.Caption = h 这个h的值就是2148550880,Label1.Caption最终应当显示2148550880才对,可是我却无法正常显示,如果VB6.0可以把这个问题解决,我也就不必再强制转换为VB.NET了 single和double放的话会出现 E- ,但是我要的是全部数字的那种 如果有办法把single和double的 E- 格式变成全部都是数字的也行 __________________________________________________________________________ unsingle long h//把h定义为无符号长整型就可以了。 __________________________________________________________________________ 原文链接:https://www.f2er.com/vb/263529.html

猜你在找的VB相关文章