English 中文(简体)
vb.net - hex, bitwise question
原标题:vb.net - hex, bitwise question

I m试图说明如何计算7个轨道和7-13个轨道的2个轴数。

Here is some example c code, just need this in vb.net:

serialBytes[2] = 0x64 & 0x7F; // Second byte holds the lower 7 bits of target.
serialBytes[3] = (0x64 >> 7) & 0x7F;   // Third data byte holds the bits 7-13 of target

The 0x7F is a constant so the only number that changes based off input is the 0x64.

Can someone help me out?

最佳回答

该法典将《刑法》转化为《刑法》:

serialBytes(2) = &h64 And &h7F
serialBytes(3) = (&h64 >> 7) And &h7F

如果海产值<代码>64<>>/代码>实际上是一种可变的投入,则仅以输入变量取代<代码>&h64。 如果投入是累进的,那么,你们就必须将结果按顺序排列,但:

serialBytes(2) = CType(value And &H7F, Byte)
serialBytes(3) = CType((value >> 7) And &H7F, Byte)
问题回答

VB. 该网络没有班轮操作员,但确实有双向操作员。

set bits1to7  = value And &H007F
set bits8to14 = value And &H3F80

<><>Edit>:

VB. 该网络确实有自“网络框架1.1”以来的轨道转移操作者(我的坏人),因此,确实有可能采取更系统的做法:

set bits1to7  = value And &H7F
set bits8to14 = (value >> 7) And &H7F




相关问题
Is Shared ReadOnly lazyloaded?

I was wondering when I write Shared ReadOnly Variable As DataType = New DataType() Or alternatively Shared ReadOnly Variable As New DataType() Is it lazy loaded or as the instance initializes? ...

Entertaining a baby with VB.NET

I would like to write a little application in VB.NET that will detect a baby s cry. How would I get started with such an application?

Choose Enter Rather than Pressing Ok button

I have many fields in the page and the last field is a dropdown with list of values. When I select an item in a dropdown and press Enter, it doesn t do the "Ok". Instead I have to manually click on Ok ...

ALT Key Shortcuts Hidden

I am using VS2008 and creating forms. By default, the underscore of the character in a textbox when using an ampersand is not shown when I run the application. ex. "&Goto Here" is not ...

Set Select command in code

On button Click I want to Set the Select command of a Gridview. I do this and then databind the grid but it doesn t work. What am i doing wrong? protected void bttnView_Click(object sender, ...

Hover tooltip on specific words in rich text box?

I m trying to create something like a tooltip suddenly hoovering over the mouse pointer when specific words in the richt text box is hovered over. How can this be done?

热门标签