Ejemplo n.º 1
0
 /// <summary>
 /// 用byte数组初始化
 /// </summary>
 /// <param name="data">接收到的byte[]数组</param>
 public DataReceivedEventArgs(byte[] data)
 {
     this.ReceivedData = data;
     if (data != null && data.Length > 0)
     {
         this.ReceivedInfo_HexString = HexHelper.ByteArray2HexString(data);
         this.ReceivedInfo_String    = Encoding.Default.GetString(data);
     }
     else
     {
         this.ReceivedInfo_HexString = string.Empty;
         this.ReceivedInfo_String    = string.Empty;
     }
 }