C#代码 变成 VB代码(List)
List(ofbyte)list=newList<byte>()for(inti=0;i<psdm.Length;i+=2){bytebt=byte.Parse(psdm...
List(of byte) list = new List<byte>()
for (int i = 0; i < psdm.Length; i += 2)
{
byte bt = byte.Parse(psdm.Substring(i, 2), System.Globalization.NumberStyles.HexNumber)
List.Add(bt)
}
psdA = List.ToArray()
psdA是个byte[6]的数组
psm是个字符串 长度为12
这个代码的功能是把 "123fd010c567"
转换为 0x12,0x3f,0xd0,0x10,0xc5,0x67
求代码 展开
for (int i = 0; i < psdm.Length; i += 2)
{
byte bt = byte.Parse(psdm.Substring(i, 2), System.Globalization.NumberStyles.HexNumber)
List.Add(bt)
}
psdA = List.ToArray()
psdA是个byte[6]的数组
psm是个字符串 长度为12
这个代码的功能是把 "123fd010c567"
转换为 0x12,0x3f,0xd0,0x10,0xc5,0x67
求代码 展开
1个回答
2011-09-14
展开全部
Dim list = new List(Of byte)()
for int i = 0 to psdm.Length step 2
Dim bt = byte.Parse(psdm.Substring(i, 2), System.Globalization.NumberStyles.HexNumber)
'上面一行不能换行,这个知道的哦
List.Add(bt)
end for
psdA = List.ToArray()
for int i = 0 to psdm.Length step 2
Dim bt = byte.Parse(psdm.Substring(i, 2), System.Globalization.NumberStyles.HexNumber)
'上面一行不能换行,这个知道的哦
List.Add(bt)
end for
psdA = List.ToArray()
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询