HslHelperByteArrayToStructT 方法 |
[商业授权] 将原始的字节数组,转换成实际的结构体对象,需要事先定义好结构体内容,否则会转换失败
[Authorization] To convert the original byte array into an actual structure object,
the structure content needs to be defined in advance, otherwise the conversion will fail
命名空间:
HslCommunication.Core
程序集:
HslCommunication (在 HslCommunication.dll 中) 版本:12.1.2.0 (12.1.2.0)
语法 public static OperateResult<T> ByteArrayToStruct<T>(
byte[] content
)
where T : struct, new()
Public Shared Function ByteArrayToStruct(Of T As {Structure, New}) (
content As Byte()
) As OperateResult(Of T)
public:
generic<typename T>
where T : value class, gcnew()
static OperateResult<T>^ ByteArrayToStruct(
array<unsigned char>^ content
)
static member ByteArrayToStruct :
content : byte[] -> OperateResult<'T> when 'T : struct, new()
参数
- content
- 类型:SystemByte
原始的字节内容
类型参数
- T
- 自定义的结构体
返回值
类型:
OperateResultT是否成功的结果对象
参见