25 May, 2009
0 Comments
0 categories
/// <summary> /// Convert a byte array to a hex string /// </summary> /// <param name="bytes"></param> /// <returns> /// Converted byte array to string /// null, when bytes == null /// </returns> public string ConvertByteArrayToString(byte[] bytes) { string result = null; // Convert byte array to string, when bytes is not null if (bytes != null) { result = BitConverter.ToString(bytes); result = result.Replace("-", string.Empty); } return result; }
Tags: C#