示例#1
0
        private void Form_Load(object sender, EventArgs e)
        {
            string snmpCommunityStrings = new SettingsDAO().GetSettingAsString("SNMPRead", String.Empty);

            foreach (string communityString in snmpCommunityStrings.Split(','))
            {
                if (communityString != String.Empty)
                {
                    lbReadStrings.Items.Add(communityString);
                }
            }

            DataTable dt = new LayIpAddressDAO().SelectAllSnmp();

            foreach (DataRow row in dt.Rows)
            {
                UltraListViewItem item = tcpipListView.Items.Add(row[0].ToString(), row[0].ToString());
                item.SubItems[0].Value = row[1].ToString();
                item.CheckState        = (Convert.ToBoolean(row[2])) ? CheckState.Checked : CheckState.Unchecked;
            }
        }