Пример #1
0
        public void TestFilters()
        {
            // test a known failing filter
            string errorString;

            Assert.IsFalse(PcapDevice.CheckFilter("some bogus filter", out errorString));

            // test a known working filter
            Assert.IsTrue(PcapDevice.CheckFilter("port 23", out errorString));
        }
Пример #2
0
        private void check(string filter)
        {
            string s;
            var    b = PcapDevice.CheckFilter(filter, out s);

            if (b)
            {
                Color color = (Color)ColorConverter.ConvertFromString("LightGreen");
                filter_cont.Background = new SolidColorBrush(color);
                filter_ok.IsEnabled    = true;
            }
            else
            {
                Color color = (Color)ColorConverter.ConvertFromString("Red");
                filter_cont.Background = new SolidColorBrush(color);
                filter_ok.IsEnabled    = false;
            }
        }
Пример #3
0
        private void check(string filter)
        {
            string s;
            var    b = PcapDevice.CheckFilter(filter, out s);

            if (b)
            {
                System.Windows.Media.Color color = (System.Windows.Media.Color)System.Windows.Media.ColorConverter.ConvertFromString("LightGreen");

                filter_tb.Background = new SolidColorBrush(color);
                go_set_tb.IsEnabled  = true;
            }
            else
            {
                System.Windows.Media.Color color = (System.Windows.Media.Color)System.Windows.Media.ColorConverter.ConvertFromString("Red");

                filter_tb.Background = new SolidColorBrush(color);
                go_set_tb.IsEnabled  = false;
            }
        }
Пример #4
0
 public static bool CheckCaptureFilter(string filter)
 {
     return(PcapDevice.CheckFilter(filter, out string outString));
 }