コード例 #1
0
ファイル: Analyzer.cs プロジェクト: kaban4ik1994/LOG
        static void Main(string[] line)
        {
            string filePath;
            var commands = CommandLine.Pars(line);
            if (!commands.TryGetValue("filepath", out filePath)) return;
            var logContent = new LogReader(filePath);
            var fileAnalyzer = new FileAnalyzer
            {
                Parameters = commands,
                RecordList = logContent.EventList.ToList()
            };

            //  var grahp = new LibraryCreateGraph(1000, 1000);
                Console.WriteLine(fileAnalyzer.GetResultsAnalyzer());
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: kaban4ik1994/LOG
        private void button1_Click(object sender, EventArgs e)
        {
            var result = openFileDialog1.ShowDialog();
            var filePath = string.Empty;

            richTextBox1.ResetText();
            if (result == DialogResult.OK)
            {
                filePath = openFileDialog1.FileName;

            }

            _logReader = new LogReader(filePath);
            var converterIp = new ConverterIp();
            var converterDate = new ConverterDate();
            dataGridView1.RowCount = _logReader.EventList.Count();
            for (var i = 0; i < _logReader.EventList.Count(); i++)
            {
                dataGridView1[0, i].Value = converterIp.Convert(new ConverterParametersIp { Ip = _logReader.EventList.ElementAt(i).Ip });
                dataGridView1[1, i].Value = "-";
                dataGridView1[2, i].Value =
                    converterDate.Convert(new ConverterParametersDate
                    {
                        DateTime = _logReader.EventList.ElementAt(i).Date
                    });
                dataGridView1[3, i].Value = _logReader.EventList.ElementAt(i).Method;
                dataGridView1[4, i].Value = _logReader.EventList.ElementAt(i).Protocol;
                dataGridView1[5, i].Value = _logReader.EventList.ElementAt(i).FileName;
                dataGridView1[6, i].Value = _logReader.EventList.ElementAt(i).FileExtension;
                dataGridView1[7, i].Value = _logReader.EventList.ElementAt(i).StatusCode;
                dataGridView1[8, i].Value = _logReader.EventList.ElementAt(i).NumberOfBytes;

            }

            startDate.Text = @"2009-12-29T12:54:59";
            endDate.Text = @"2009-12-29T12:54:59";
        }