Esempio n. 1
0
        private void BUT_loganalysis_Click(object sender, EventArgs e)
        {
            using (OpenFileDialog ofd = new OpenFileDialog())
            {
                ofd.Filter = "*.log;*.bin|*.log;*.bin";
                ofd.ShowDialog();

                if (ofd.FileName != "")
                {
                    string newlogfile = null;

                    if (ofd.FileName.ToLower().EndsWith(".bin"))
                    {
                        newlogfile = Path.GetTempFileName() + ".log";

                        BinaryLog.ConvertBin(ofd.FileName, newlogfile);

                        ofd.FileName = newlogfile;
                    }

                    string xmlfile = LogAnalyzer.CheckLogFile(ofd.FileName);

                    GC.Collect();

                    if (File.Exists(xmlfile))
                    {
                        var out1 = LogAnalyzer.Results(xmlfile);

                        Controls.LogAnalyzer frm = new Controls.LogAnalyzer(out1);

                        frm.Show();
                    }
                    else
                    {
                        CustomMessageBox.Show("Bad input file");
                    }

                    if (!String.IsNullOrEmpty(newlogfile))
                    {
                        try
                        {
                            File.Delete(newlogfile);
                        }
                        catch
                        {
                        }
                    }
                }
            }
        }
        private void but_loganalysis_Click(object sender, EventArgs e)
        {
            using (OpenFileDialog ofd = new OpenFileDialog())
            {
                ofd.ShowDialog();

                if (ofd.FileName != "")
                {
                    string xmlfile = LogAnalyzer.CheckLogFile(ofd.FileName);

                    if (File.Exists(xmlfile))
                    {
                        var out1 = LogAnalyzer.Results(xmlfile);

                        Controls.LogAnalyzer frm = new Controls.LogAnalyzer(out1);

                        frm.Show();
                    }
                    else
                    {
                        CustomMessageBox.Show("Bad input file");
                    }
                }
            }
        }