求救各位大虾,数据转换的问题 例如,10进制数88转成16进制为0058,再ASCII编码得“\x30\x30\x35\x38”。如何用C#实现 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 10-16转换:int I, J; string S; I = 123; S = I.ToString("X"); J = int.Parse(S,System.Globalization.NumberStyles.AllowHexSpecifier);16-ascii转换:string[] keys = Console.ReadLine().Split(' ');//读取用空格分成的16进制码 foreach (string key in keys) { int code = Convert.ToInt32(key, 16);//将16进制字符串转换成其ASCII码(实际是Unicode码) char c = (char)code;//取得这个Unicode码表示的char(强制转换就行) Console.Write(c.ToString());//输出。 } Console.ReadLine() // 10进制数88转成16进制为0058,再ASCII编码得“\x30\x30\x35\x38”ulong source = 88L;var result = source.ToString("X4").Select(c =>string.Format(@"\x{0:X2}",(byte)c)).ToList();result.ForEach(c=>Console.Write(c));结果:\x30\x30\x35\x38 int i= 88; string s = i.ToString("X4"); string r = ""; string pre=@"\x"; foreach(char item in s) { r += pre+((int)item).ToString("X"); } 求助 猜算式 c# socket问题请教 c# webbrowser 问题 刻绘软件的原理是什么?大家有做过这方面开发的吗? 大家帮帮忙,怎么我在做蜘蛛时总是找不到原码 winform 中想远程操作另外一台电脑上的文件 怎么实现 怎么知道自己的积分? 求flash控件的属性及事件方法在C#中 datagridview的一些简单问题 关于x64自己编写的控件不能使用的问题 嵌入资源文件(resx)中的音频文件播放问题?急!!!!! 由文件地址获取文件流
int I, J; string S;
I = 123;
S = I.ToString("X");
J = int.Parse(S,System.Globalization.NumberStyles.AllowHexSpecifier);16-ascii转换:string[] keys = Console.ReadLine().Split(' ');//读取用空格分成的16进制码
foreach (string key in keys)
{
int code = Convert.ToInt32(key, 16);//将16进制字符串转换成其ASCII码(实际是Unicode码)
char c = (char)code;//取得这个Unicode码表示的char(强制转换就行)
Console.Write(c.ToString());//输出。
}
Console.ReadLine()
ulong source = 88L;
var result = source.ToString("X4").Select(c =>string.Format(@"\x{0:X2}",(byte)c)).ToList();
result.ForEach(c=>Console.Write(c));结果:
\x30\x30\x35\x38
int i= 88;
string s = i.ToString("X4");
string r = "";
string pre=@"\x";
foreach(char item in s)
{
r += pre+((int)item).ToString("X");
}