c# - 任何人都可以告诉这是什么类型的转换

标签 c# .net-2.0

enter image description here

我将输入作为左侧 11 位数字,输出应该在此之前,或者任何人都可以告诉我如何通过将这些输入作为字节数组来获得输出

最佳答案

Example of first line

@更改为支持点 string[] line = "82 44 b4 2e 39 39 39 39 39 35".Split(' ');

byte[] bytes = new byte[line.Length];

for (int i = 0; i < line.Length; i++) {
  int candidate = Convert.ToInt32(line[i], 16);
  if (!(!(candidate < 0x20 || candidate > 127)))
    candidate = 46; //.
  bytes[i] = Convert.ToByte(candidate);
}

string s =  System.Text.Encoding.ASCII.GetString(bytes);

关于c# - 任何人都可以告诉这是什么类型的转换,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5651208/

相关文章:

c# - 每层的 MVVM 角色

c# - C# 中的 CodePointAt 等价物

c# - 如何访问字典中唯一的 KeyValuePair?

c# - 使用 C# 下载 Twilio 录音

.net - 如何在 dotnet 上以编程方式截取屏幕截图并通过电子邮件发送

c# - 使用 Asp.Net 赢得应用商店

c# - 我可以仅按文件名查找文件吗(即扩展名未知)

c# - WebResource.axd 错误 - "This is an invalid webresource request."

encoding - HttpWebRequest:使用正确的编码接收响应

.net - 无法将 Rhino Mocks 3.5 添加到 Visual Studio 2010 中的 .NET 2.0 项目