ulong big2little(int  code)      //将big位序转换为little位序
        {
             ulong value;
             value = ((((ulong)(code)&(ulong)0x000000ffUL)<<24)|(((ulong)(code)&(ulong)0x0000ff00UL)<<8)|(((ulong)(code)&(ulong)0x00ff0000UL)>>8)|(((ulong)(code)&(ulong)0xff000000UL)>>24));
             return value;
        }谁能帮忙把这个方法 专程VB语言?? 谢谢

解决方案 »

  1.   

    将强制类型转换写成 CType(),运算符 & 变成 and,| 变成 or。类型调整为CLR类型。
      

  2.   

    Private Function big2little(code As Integer) As ULong
    '将big位序转换为little位序
    Dim value As ULong
    value = (((CULng(code) And CULng(&HffUL)) << 24) Or ((CULng(code) And CULng(&Hff00UL)) << 8) Or ((CULng(code) And CULng(&Hff0000UL)) >> 8) Or ((CULng(code) And CULng(&Hff000000UL)) >> 24))
    Return value
    End Function转换工具
    http://www.developerfusion.com/tools/convert/csharp-to-vb/
      

  3.   


            Function big2little(ByVal code As System.Int32) As System.UInt64
            Dim value As System.UInt64
            value = _
            ((CType(code, System.UInt64) And CType(&HFFUI, System.UInt64)) << 24) _
            Or ((CType(code, System.UInt64) And CType(&HFF00UI, System.UInt64)) << 8) _
            Or ((CType(code, System.UInt64) And CType(&HFF0000, System.UInt64)) >> 8) _
            Or ((CType(code, System.UInt64) And CType(&HFF000000UI, System.UInt64)) >> 24)
            Return value
        End Function