C#将string转为十六进制

/// <summary>
        /// 将string格式转化为十六进制数据
        /// </summary>
        /// <param name="msg">
        /// </param>
        /// <returns>
        /// </returns>
        public static string tenToSixteen(string msg)
        {
            long number = Convert.ToInt64(msg);
            return Convert.ToString(number, 16);
        }

 

你可能感兴趣的