using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ivf_tl_Entity.ComEntitys { public class StringHelper { /// /// 字节数组转16进制字符串 /// /// /// public static string ByteToHexStr(byte[] bytes) { string returnStr = ""; if (bytes != null) { for (int i = 0; i < bytes.Length; i++) { returnStr += bytes[i].ToString("X2") + " "; } } return returnStr; } /// /// 时:分:秒.毫秒 /// /// /// public static string TimeToString(TimeSpan obj) { string totalTimeStr = String.Format("{0:00}:{1:00}:{2:00}.{3:00}", obj.Hours, obj.Minutes, obj.Seconds, obj.Milliseconds / 10); return totalTimeStr; } } }