コード例 #1
0
ファイル: Form1.cs プロジェクト: Kirito2105/sabakas
        /// Ф-ия выводит информацию о DNS
        public void MakeDNS(byte[] byteData, int nLength)
        {
            DNSHeader dnsHeader = new DNSHeader(byteData, nLength);
            this.dgvParamProt.Rows.Clear();
            this.dgvParamProt.Columns.Clear();

            DataGridViewTextBoxColumn col0 = new DataGridViewTextBoxColumn();
            col0.HeaderText = "Описание";
            col0.Name = "ID";
            DataGridViewTextBoxColumn col1 = new DataGridViewTextBoxColumn();
            col1.HeaderText = "Значение";
            col1.Name = "ID1";

            this.dgvParamProt.Columns.Add(col0);
            this.dgvParamProt.Columns.Add(col1);

            dgvParamProt.Rows.Add("Identification:", dnsHeader.Identification);
            dgvParamProt.Rows.Add("Flags:", dnsHeader.Flags);
            dgvParamProt.Rows.Add("Questions:", dnsHeader.TotalQuestions);
            dgvParamProt.Rows.Add("Answer RRs: ", dnsHeader.TotalAnswerRRs);
            dgvParamProt.Rows.Add("Authority RRs:", dnsHeader.TotalAuthorityRRs);
            dgvParamProt.Rows.Add("Additional RRs:", dnsHeader.TotalAdditionalRRs);
        }