Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/325.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 解码NS记录的DNSrecord系统字节数组_C# - Fatal编程技术网

C# 解码NS记录的DNSrecord系统字节数组

C# 解码NS记录的DNSrecord系统字节数组,c#,C#,我在将系统字节数组解码为字符串时遇到问题。当尝试对字节数组进行编码时,不管使用UTF-8还是ASCII编码,我最终得到一个四叶苜蓿作为其中一个字符。下面是我的伪代码片段: byte[] dnsrecord = {dnsRecord here} int count = dnsrecord.length - 27; //the actual DNS record states at index 27. string encodedstring = Encoding.UTF8.GetString(d

我在将系统字节数组解码为字符串时遇到问题。当尝试对字节数组进行编码时,不管使用UTF-8还是ASCII编码,我最终得到一个四叶苜蓿作为其中一个字符。下面是我的伪代码片段:

byte[] dnsrecord = {dnsRecord here} int count = dnsrecord.length - 27; //the actual DNS record states at index 27.

string encodedstring = Encoding.UTF8.GetString(dnsrecord,27,count);
DNS记录从索引27开始。然而,一旦进入域名,“.”就变成了四叶三叶草。它没有被正确解码。有没有人遇到过这个问题,或者知道我应该尝试什么其他编码