示例#1
0
        public override byte[] BodyWriteTo()
        {
            BinaryWriter aDest = new BinaryWriter(new MemoryStream());

            DNSPacket.GenerateName(aDest, this.fTargetName);
            aDest.Flush();
            byte[] buffer = (aDest.BaseStream as MemoryStream).ToArray();
            aDest.Close();
            return(buffer);
        }
示例#2
0
 public void WriteTo(BinaryWriter aDest)
 {
     DNSPacket.GenerateName(aDest, this.fName);
     aDest.Write(DNSPacket.H2N((ushort)this.fType));
     if (this.fClearCache)
     {
         aDest.Write(DNSPacket.H2N((ushort)(this.fClass | ((DNSClass)0x8000))));
     }
     else
     {
         aDest.Write(DNSPacket.H2N((ushort)this.fClass));
     }
 }
示例#3
0
 public void WriteTo(BinaryWriter aDest)
 {
     DNSPacket.GenerateName(aDest, this.fName);
     aDest.Write(DNSPacket.H2N((ushort)this.Type));
     if (this.fClearCache)
     {
         aDest.Write(DNSPacket.H2N((ushort)(this.fClass | ((DNSClass)0x8000))));
     }
     else
     {
         aDest.Write(DNSPacket.H2N((ushort)this.fClass));
     }
     byte[] buffer = this.BodyWriteTo();
     aDest.Write(DNSPacket.H2N((uint)this.fTTL));
     aDest.Write(DNSPacket.H2N((ushort)buffer.Length));
     aDest.Write(buffer, 0, buffer.Length);
 }