Exemple #1
0
        void LoadFilters()
        {
            int lastIndex = Application.ExecutablePath.LastIndexOf('\\');

            m_szFiltersPath = Application.ExecutablePath.Remove(lastIndex, Application.ExecutablePath.Length - lastIndex)
                              + "\\filter\\";
            String[] ssf = Directory.GetFiles(m_szFiltersPath, "*.flt");
            comboBoxFilters.Items.Add("NONE");
            for (int i = 0; ssf != null && i < ssf.Length; i++)
            {
                SnifferFilter filter = new SnifferFilter();
                filter.Load(ssf[i]);
                comboBoxFilters.Items.Add(filter);
            }
            comboBoxFilters.Items.Add("New...");
            comboBoxFilters.SelectedIndex = 0;
            toolStripButtonFilter.Enabled = false;
            m_filterCurIndex = 0;
        }