怎么将这段JS代码转成VB的代码呢?
自己尝试转换了下,因为对JS不熟悉所以没能转过来,
希望各位会的朋友帮一下忙。function hex2binl( hex ) 
{
/*  Clean-up hex encoded input string */
hex = hex.toLowerCase() ;
hex = hex.replace( / /g , "");
var bin =[] ;
/* Transfrom to array of integers (binary representation) */ 
for ( i=0 ; i < hex.length*4   ; i=i+8 )  {
  octet =  parseInt( hex.substr( i/4 , 2) , 16) ;
  bin[i>>5] |= ( octet & 255 ) << (i%32);
}
return bin;
}

解决方案 »

  1.   


    自己写了一部分就差一句不会的,,
    bin[i>>5] |= ( octet & 255 ) << (i%32);
    这句我转不来了,,有没有人来帮帮我
    Function hex2binl(hex)
    hex = LCase(hex)
    hex = Replace(hex, " ", "")For i = 0 To Len(hex) * 4
    If s < Len(hex) * 4 Then
    octet = Val("&H" & Mid(hex, (s / 4) + 1, 2))
    s = s + 8
    Else
    Exit For
    End If
    Next i
    hex2binl = bin
    End Function
      

  2.   

    http://topic.csdn.net/u/20090818/18/ed040284-eec9-431f-a510-c9be46c7a591.html
    看我10楼的代码。
      

  3.   

    bin(i \ 32) = bin(i \ 32) or ((octet and &HFF&) * (2 ^ (i mod 32)))
      

  4.   

    运行溢出。。感谢 caozhy !! 看了10楼后,原来是那么回事.
    可以转换了,,谢谢了