Beispiel #1
0
        private void Renew()
        {
            listView1.Items.Clear();
            string service = hostInstance.GetServices();

            string[] rows = service.Split(new string[] { Environment.NewLine }, StringSplitOptions.None);

            foreach (string row in rows)
            {
                if (row != string.Empty)
                {
                    string[]     fields = row.Split(new string[] { "|*|" }, StringSplitOptions.RemoveEmptyEntries);
                    ListViewItem item   = new ListViewItem(fields[0]);
                    for (int i = 1; i < fields.Length; i++)
                    {
                        item.SubItems.Add(fields[i]);
                    }
                    listView1.Items.Add(item);
                }
            }
        }