示例#1
0
        private void getStats()
        {
            MibTcpStats mtcp = Win32.GetTcpStats();

            label1.Text  = String.Format("ActiveOpens: {0}", mtcp.ActiveOpens);
            label2.Text  = String.Format("AttemptFails: {0}", mtcp.AttemptFails);
            label3.Text  = String.Format("CurrEstab: {0}", mtcp.CurrEstab);
            label4.Text  = String.Format("EstabResets: {0}", mtcp.EstabResets);
            label5.Text  = String.Format("InErrs: {0}", mtcp.InErrs);
            label6.Text  = String.Format("InSegs: {0}", mtcp.InSegs);
            label7.Text  = String.Format("MaxConn: {0}", mtcp.MaxConn);
            label8.Text  = String.Format("NumConns: {0}", mtcp.NumConns);
            label9.Text  = String.Format("OutRsts: {0}", mtcp.OutRsts);
            label10.Text = String.Format("OutSegs: {0}", mtcp.OutSegs);
            label11.Text = String.Format("PassiveOpens: {0}", mtcp.PassiveOpens);
            label12.Text = String.Format("RetransSegs: {0}", mtcp.RetransSegs);
            label13.Text = String.Format("RtoAlgorithm: {0}", mtcp.RtoAlgorithm);
            label14.Text = String.Format("RtoMax: {0}", mtcp.RtoMax);
            label15.Text = String.Format("RtoMin: {0}", mtcp.RtoMin);

            MibUdpStats mudp = Win32.GetUdpStats();

            label16.Text = String.Format("InDatagrams: {0}", mudp.InDatagrams);
            label17.Text = String.Format("InErrors: {0}", mudp.InErrors);
            label18.Text = String.Format("NoPorts: {0}", mudp.NoPorts);
            label19.Text = String.Format("NumAddrs: {0}", mudp.NumAddrs);
            label20.Text = String.Format("OutDatagrams: {0}", mudp.OutDatagrams);
        }
 internal extern static uint GetUdpStatisticsEx(out MibUdpStats statistics, AddressFamily family);