当前位置:网站首页>C#在控制台应用程序中显示输出字节型数据
C#在控制台应用程序中显示输出字节型数据
2022-08-08 23:56:00 【无悔青春_j进无止境】
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication6
{
class Program
{
static void Main(string[] args)
{
string[] message = new string[2]{ "你好","hello"} ;
byte[] data=new byte[message.Length];
for (int i = 0; i < message.Length; i++)
{
data[i]=Convert.ToByte(Convert.ToInt32(message[i]));
}
foreach (byte b in data)
{
Console.WriteLine(b.ToString("X2")+" "); //法1
}
//Console.WriteLine(BitConverter.ToString(data));//法2
Console.ReadLine();
}
}
}
边栏推荐
猜你喜欢
随机推荐
Get the start time of the week
Common problems in installing mysql in linux environment and using it
风控建模四:逻辑回归评分卡开发
机器学习建模高级用法!构建企业级AI建模流水线
八 Node.js中使用MySQL
一命令删除所有指定进程
moved异常,ask重定向
HCIP2--RIP实验
13 Spark on RDD 全局累加器
06 Spark on RDD序列化问题
Risk Control Modeling II: Modeling Scheme formulation
第三章 数据库设计
51nod 1706 最短路 + 思维
获取当前时间的前/后某一天的日期
BGP实验
第二章 关系数据库概述
Risk Control Modeling 1: Definition of Good and Bad Labels
并发编程第5篇,Synchronized的原理
Ubuntu下Docker安装Redis (快速简便)
ArrayAccess 接口用处