2024年1月21日发(作者:)
///
public void SetCMD(d Cmd)
{
try
{
= ;
if ()
{
StringBuilder sb = new StringBuilder();
for (int i = 0; i < ; i++)
{
Format("{0:x2}", tes[i]);
}
= ng();
}
else
{
= new ASCIIEncoding().GetString(tes);
}
}
catch (Exception ex)
{
(e);
}
}
#endregion
}
}
using System;
using c;
using ;
namespace Model
{
///
/// 命令对象
///
public class Command
{
bool _IsHex = true;
byte[] _DataBytes = null;
///
/// 是否16进制数据
///
public bool IsHex
{
set {
_IsHex = value;
}
get {
return _IsHex;
}
}
///
/// byte数据
///
public byte[] DataBytes
{
set
{
_DataBytes = value;
}
get
{
return _DataBytes;
}
}
}
}
发布评论