哪位大虾能否帮忙把下面这段vb6.0代码转成vb.net代码,谢谢 5
PrivateDeclareSubCopyMemoryLib"kernel32"Alias"RtlMoveMemory"(DestinationAsAny,SourceA...
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
sub Read(bData() As Byte)
Dim n As Long
Dim bytAll As Byte
Dim lpValue As Long
Dim tempbyte(3) As Byte
Dim DataTemp As Byte
bytAll = bData(8)
ReDim iDataA(bytAll / 2 - 1) As Integer
lpValue = VarPtr(bData(9))
For n = 0 To bytAll / 2 - 1 Step 1
CopyMemory tempbyte(0), ByVal lpValue + n * 2, 2
DataTemp = tempbyte(0)
tempbyte(0) = tempbyte(1)
tempbyte(1) = DataTemp
CopyMemory iDataA(n), tempbyte(0), 2
Next
End sub 展开
sub Read(bData() As Byte)
Dim n As Long
Dim bytAll As Byte
Dim lpValue As Long
Dim tempbyte(3) As Byte
Dim DataTemp As Byte
bytAll = bData(8)
ReDim iDataA(bytAll / 2 - 1) As Integer
lpValue = VarPtr(bData(9))
For n = 0 To bytAll / 2 - 1 Step 1
CopyMemory tempbyte(0), ByVal lpValue + n * 2, 2
DataTemp = tempbyte(0)
tempbyte(0) = tempbyte(1)
tempbyte(1) = DataTemp
CopyMemory iDataA(n), tempbyte(0), 2
Next
End sub 展开
1个回答
展开全部
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
sub Read(bData() As Byte)
Dim n As Long
Dim bytAll As Byte
Dim lpValue As Long
Dim tempbyte(3) As Byte
Dim DataTemp As Byte
bytAll = bData(8)
ReDim iDataA(bytAll / 2 - 1) As Integer
lpValue = VarPtr(bData(9))
For n = 0 To bytAll / 2 - 1 Step 1
CopyMemory tempbyte(0), ByVal lpValue + n * 2, 2
DataTemp = tempbyte(0)
tempbyte(0) = tempbyte(1)
tempbyte(1) = DataTemp
CopyMemory iDataA(n), tempbyte(0), 2
Next
sub Read(bData() As Byte)
Dim n As Long
Dim bytAll As Byte
Dim lpValue As Long
Dim tempbyte(3) As Byte
Dim DataTemp As Byte
bytAll = bData(8)
ReDim iDataA(bytAll / 2 - 1) As Integer
lpValue = VarPtr(bData(9))
For n = 0 To bytAll / 2 - 1 Step 1
CopyMemory tempbyte(0), ByVal lpValue + n * 2, 2
DataTemp = tempbyte(0)
tempbyte(0) = tempbyte(1)
tempbyte(1) = DataTemp
CopyMemory iDataA(n), tempbyte(0), 2
Next
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询