哪位大虾能否帮忙把下面这段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
展开
 我来答
yuhangcyn
2011-10-29
知道答主
回答量:7
采纳率:0%
帮助的人:1.2万
展开全部
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
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式