Beispiel #1
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            if (rbtnAll.Checked)
            {
                filter.Method = 0;
            }
            if (rbtnGet.Checked)
            {
                filter.Method = 1;
            }
            if (rbtnPost.Checked)
            {
                filter.Method = 2;
            }

            if (cbAllowQueryByIP.Checked)
            {
                filter.IPList.Clear();
                filter.AllowQueryByIP = true;
                string[] ss = txtIPList.Text.Trim().Split(',');
                foreach (string s in ss)
                {
                    filter.AddIP(s.Trim());
                }
            }
            else
            {
                filter.AllowQueryByIP = false;
            }

            if (cbAllowQueryByIPLocation.Checked)
            {
                filter.IPLocationList.Clear();
                filter.AllowQueryByIPLocation = true;
                string[] ss = txtIPLocationList.Text.Trim().Split(',');
                foreach (string s in ss)
                {
                    filter.AddIPLocation(s.Trim());
                }
            }
            else
            {
                filter.AllowQueryByIPLocation = false;
            }

            if (cbAllowQueryByReferer.Checked)
            {
                filter.RefererList.Clear();
                filter.AllowQueryByReferer = true;
                string[] ss = txtRefererList.Text.Trim().ToLower().Split(',');
                foreach (string s in ss)
                {
                    filter.AddReferer(s.Trim());
                }
            }
            else
            {
                filter.AllowQueryByReferer = false;
            }

            if (cbAllowQueryByStatus.Checked)
            {
                filter.StatusList.Clear();
                filter.AllowQueryByStatus = true;
                string[] ss = txtStatusList.Text.Trim().Split(',');
                foreach (string s in ss)
                {
                    filter.AddStatus(s.Trim());
                }
            }
            else
            {
                filter.AllowQueryByStatus = false;
            }

            if (cbAllowQueryByUri.Checked)
            {
                filter.UriList.Clear();
                filter.AllowQueryByUri = true;
                string[] ss = txtUriList.Text.Trim().ToLower().Split(',');
                foreach (string s in ss)
                {
                    filter.AddUri(s.Trim());
                }
            }
            else
            {
                filter.AllowQueryByUri = false;
            }

            if (cbAllowQueryByUserAgent.Checked)
            {
                filter.UserAgentList.Clear();
                filter.AllowQueryByUserAgent = true;
                string[] ss = txtUserAgentList.Text.Trim().Split(',');
                foreach (string s in ss)
                {
                    filter.AddUserAgent(s.Trim());
                }
            }
            else
            {
                filter.AllowQueryByUserAgent = false;
            }

            if (cbAllowQueryByTime.Checked)
            {
                filter.AllowQueryByTime = true;
                filter.BeginTime        = dtpBeginTime.Value;
                filter.EndTime          = dtpEndTime.Value;
            }
            else
            {
                filter.AllowQueryByTime = false;
            }

            if (parser == null)
            {
                parser = new IISLogParser();
                parser.Show(dockPanel);
            }
            parser.Activate();
            parser.ParseLog(filter);
        }
        private void btnOK_Click(object sender, EventArgs e)
        {
            if (rbtnAll.Checked) filter.Method = 0;
            if (rbtnGet.Checked) filter.Method = 1;
            if (rbtnPost.Checked) filter.Method = 2;

            if (cbAllowQueryByIP.Checked)
            {
                filter.IPList.Clear();
                filter.AllowQueryByIP = true;
                string[] ss = txtIPList.Text.Trim().Split(',');
                foreach (string s in ss)
                {
                    filter.AddIP(s.Trim());
                }
            }
            else
            {
                filter.AllowQueryByIP = false;
            }

            if (cbAllowQueryByIPLocation.Checked)
            {
                filter.IPLocationList.Clear();
                filter.AllowQueryByIPLocation = true;
                string[] ss = txtIPLocationList.Text.Trim().Split(',');
                foreach (string s in ss)
                {
                    filter.AddIPLocation(s.Trim());
                }
            }
            else
            {
                filter.AllowQueryByIPLocation = false;
            }

            if (cbAllowQueryByReferer.Checked)
            {
                filter.RefererList.Clear();
                filter.AllowQueryByReferer = true;
                string[] ss = txtRefererList.Text.Trim().ToLower().Split(',');
                foreach (string s in ss)
                {
                    filter.AddReferer(s.Trim());
                }
            }
            else
            {
                filter.AllowQueryByReferer = false;
            }

            if (cbAllowQueryByStatus.Checked)
            {
                filter.StatusList.Clear();
                filter.AllowQueryByStatus = true;
                string[] ss = txtStatusList.Text.Trim().Split(',');
                foreach (string s in ss)
                {
                    filter.AddStatus(s.Trim());
                }
            }
            else
            {
                filter.AllowQueryByStatus = false;
            }

            if (cbAllowQueryByUri.Checked)
            {
                filter.UriList.Clear();
                filter.AllowQueryByUri = true;
                string[] ss = txtUriList.Text.Trim().ToLower().Split(',');
                foreach (string s in ss)
                {
                    filter.AddUri(s.Trim());
                }
            }
            else
            {
                filter.AllowQueryByUri = false;
            }

            if (cbAllowQueryByUserAgent.Checked)
            {
                filter.UserAgentList.Clear();
                filter.AllowQueryByUserAgent = true;
                string[] ss = txtUserAgentList.Text.Trim().Split(',');
                foreach (string s in ss)
                {
                    filter.AddUserAgent(s.Trim());
                }
            }
            else
            {
                filter.AllowQueryByUserAgent = false;
            }

            if (cbAllowQueryByTime.Checked)
            {
                filter.AllowQueryByTime = true;
                filter.BeginTime = dtpBeginTime.Value;
                filter.EndTime = dtpEndTime.Value;
            }
            else
            {
                filter.AllowQueryByTime = false;
            }

            if (parser == null)
            {
                parser = new IISLogParser();
                parser.Show(dockPanel);
            }
            parser.Activate();
            parser.ParseLog(filter);
        }