一共两处错误:
1,java:
 private String toHexString(byte abyte0[])
{
String s = "";
for(int i = 0; i < abyte0.length; i++)
{
    byte byte0 = abyte0[i];
    String s1 = Integer.toHexString(byte0);
If (s1.length() > 2) Then
s1 = s1.substring(s1.length() - 2);
    If (s1.length() < 2) Then
s1 = "0" + s1;
    s = s + s1;
}return s.toUpperCase();
}
转化成vb.net
Private Function toHexString(ByVal abyte0() As Byte) As String   
        Dim s As String = ""
        For i As Integer = 0 To abyte0.Length - 1
            Dim byte0 As Byte = abyte0(i)
            Dim s1 As String = toHexString(byte0)   ''''byte0处报错,报错内容:类型“byte”的值无法转换为“byte的一维数组”
            If s1.Length > 2 Then
                s1 = s1.Substring(s1.Length() - 2)  
            End If
            If s1.Length < 2 Then
                s1 = "0" + s1
            End If
            s = s + s1
        Next
        Return s.ToUpper
    End Function
2:java
Dim SubKey(2, 16, 48) As Byte
doDES(abyte6, abyte6, SubKey[1], byte1);
转为vb.net后
Dim SubKey(2, 16, 48) As Byte
doDES(abyte6, abyte6, SubKey(1), byte1)  ''''在SubKey(1)出报错:索引数少于索引数组的维数以上两问题待高手解答,谢谢。

解决方案 »

  1.   

    坏了,没装VB.netDim s1 As String = toHexString(byte0) 这里应该是传递abyte0吧?
      

  2.   

    回楼上,传的是byte0,非abyte0
      

  3.   

    ①toHexString的参数是一个byte的数组
    如果传一个byte类型的数值必然会报错②SubKey属于三维数组
    在vb.net中不能通过SubKey(1)获得一个二维数组
      

  4.   

    第一个那个可把toHexString方法变为Hex方法
    如toHexString(byte0)=》Hex(byte0)
    第二个你可以想其他办法进行转换
      

  5.   

    SubKey属于三维数组
    在vb.net中不能通过SubKey(1)获得一个二维数组那要通过自定义函数解决?