什么是c#等效的MAKEWORD c++ Windows宏?

What is the C# equivalent of the MAKEWORD c++ Windows Macro?

本文关键字:c++ Windows MAKEWORD 什么      更新时间:2023-10-16

我需要将一些c++遗留代码转换为c#,我想知道MAKEWORD c++ Windows宏的c#等效是什么?

public static uint MakeWord(byte low, byte high)
{
    return ((uint)high << 8) | low;
}

但是,您可能需要将结果作为int,这取决于您对它所做的操作(必要时进行强制转换)。