我有一行用C#編寫的代碼,需要轉換爲Vb.Net。將GetBytes C#行轉換爲VB.Net
在C#
我有此塊...
// Calculate number of 64K blocks
uint rowsPerBlock = _MAXBLOCK/widthLength;
uint blockSize = rowsPerBlock*widthLength;
uint blockCount;
ushort length;
uint remainder=dcSize;
後來長度變量被分配的值,並且用於其他計算
length = (ushort)((remainder < blockSize) ? remainder : blockSize);
if (length == remainder)
{
comp.WriteByte(0x01);
}
else
{
comp.WriteByte(0x00);
}
comp.Write(BitConverter.GetBytes(length), 0, 2);
// Write one's compliment of LEN
所有上述我的轉換,除了下面的行。
comp.Write(BitConverter.GetBytes((ushort)~length), 0, 2);
這條線的正確轉換是什麼?
感謝
[C#to VB](http://converter.telerik.com/)轉換器。 – Magnus