Convert C Code To .net (C# Or VB.net)
I Need Convert This Code To .net (C# or VB.net)<br>
Please Help Me For Do This:I Need Convert This Code To .net (C# or VB.net)<br>

Please Help Me For Do This:<br>

    word CalCRCCCITT(word val,byte data8)
    {
    byte tmp,i;
    word CRC;
    tmp = (val>>8)^data8;
    CRC = 0;
    for (i=8;i;i--)
    {
    if (0x8000&CRC)
    {
    CRC <<= 1;
    CRC ^= 0x1021;
    }
    else
    {
    CRC <<= 1;
    }
    if (tmp&0x80)
    CRC ^= 0x1021;
    tmp <<= 1;
    }
    val <<= 8;
    val ^= CRC;
    return val;
    }
    word CalDemo(byte *tb_Bufp,byte tb_Len)
    {
    word tw_Val;
    byte i;
    tw_Val=0xffff;
    for (i=0;i<tb_Len;i++)
    {
    tw_Val=CalCRCCCITT(tw_Val,(*tb_Bufp++) );
    }
    return tw_Val;
    }


Convert C Code To .net (C# Or VB.net)
===

I Need Convert This Code To .net (C# or VB.net)<br>
Please Help Me For Do This:I Need Convert This Code To .net (C# or VB.net)<br>

Please Help Me For Do This:<br>

    word CalCRCCCITT(word val,byte data8)
    {
    byte tmp,i;
    word CRC;
    tmp = (val>>8)^data8;
    CRC = 0;
    for (i=8;i;i--)
    {
    if (0x8000&CRC)
    {
    CRC <<= 1;
    CRC ^= 0x1021;
    }
    else
    {
    CRC <<= 1;
    }
    if (tmp&0x80)
    CRC ^= 0x1021;
    tmp <<= 1;
    }
    val <<= 8;
    val ^= CRC;
    return val;
    }
    word CalDemo(byte *tb_Bufp,byte tb_Len)
    {
    word tw_Val;
    byte i;
    tw_Val=0xffff;
    for (i=0;i<tb_Len;i++)
    {
    tw_Val=CalCRCCCITT(tw_Val,(*tb_Bufp++) );
    }
    return tw_Val;
    }

