예제 #1
0
 private void logFileStart_Click(object sender, EventArgs e)
 {
     if (Utils.IOHelper.isFile(this.logFile.Text))
     {
         //生成需要合并的文件
         WelcomeForm.logFileName = this.logFile.Text;
         if (logFileName == null)
         {
             MessageBox.Show("ops,wrong file", "not a logat files", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         }
         else
         {
             WelcomeForm.logDirPath = null;
             //调用DLL中的方法分析log,并返回需要的数据,放入自己建立的结构体数组中
             Console.WriteLine("C#, logFileName:" + logFileName);
             LOGDLL.LogResult[] myLog = LOGDLL.Analysis(logFileName);
             //打开新的窗体
             Form newForm = new LogAnalysis(myLog);
             newForm.Show();
             //this.Hide();
         }
     }
     else
     {
         MessageBox.Show("ops,should be a file!", "not file", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }
예제 #2
0
        private void startButton_Click(object sender, EventArgs e)
        {
            List <logcatInfo> logCheckes = new List <logcatInfo>();

            for (int i = 0; i < this.listView1.Items.Count; i++)
            //for (int i = 0; i < this.logcatList.Count; i++)
            {
                if (this.listView1.Items[i].Checked)
                {
                    logCheckes.Add(logcatList[i]);
                }
            }
            //利用list 中 sort排序, 自定义排序方法
            logCheckes.Sort(Compare);
            CombineFile(logCheckes, WelcomeForm.logDirPath + "\\LOGANALYSIS");

            for (int i = 0; i < logCheckes.Count; i++)
            {
                Console.WriteLine(logCheckes[i].name + "----" + logCheckes[i].startTime);
            }

            WelcomeForm.logFileName = WelcomeForm.logDirPath + "\\LOGANALYSIS";
            //分析log,打开新窗口
            LOGDLL.LogResult[] myLog = LOGDLL.Analysis(WelcomeForm.logDirPath + "\\LOGANALYSIS");
            Form logAnalysisForm     = new LogAnalysis(myLog);

            logAnalysisForm.Show();
            this.Close();


            //处理kernel log
            String kernelLogPath = Utils.IOHelper.FindFileInDir(WelcomeForm.logDirPath, "dmesglog");

            //EventListView.Execute(Application.StartupPath + @"\dmesgtime.exe " + "\"" + kernelLogPath + "\"" + " 1", 1);
            EventListView.Execute("dmesgtime.exe", "\"" + kernelLogPath + "\" 1");
        }
 private void logFileStart_Click(object sender, EventArgs e)
 {
     if (Utils.IOHelper.isFile(this.logFile.Text))
     {
         //生成需要合并的文件
         WelcomeForm.logFileName = this.logFile.Text;
         if (logFileName == null)
         {
             MessageBox.Show("ops,wrong file", "not a logat files", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         }
         else
         {
             WelcomeForm.logDirPath = null;
             //调用DLL中的方法分析log,并返回需要的数据,放入自己建立的结构体数组中
             Console.WriteLine("C#, logFileName:" + logFileName);
             LOGDLL.LogResult[] myLog = LOGDLL.Analysis(logFileName);
             //打开新的窗体
             Form newForm = new LogAnalysis(myLog);
             newForm.Show();
             //this.Hide();
         }
     }
     else
     {
         MessageBox.Show("ops,should be a file!", "not file", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }
        private void startButton_Click(object sender, EventArgs e)
        {
            List<logcatInfo> logCheckes = new List<logcatInfo>();

            for (int i = 0; i < this.listView1.Items.Count; i++)
            //for (int i = 0; i < this.logcatList.Count; i++)
            {
                if (this.listView1.Items[i].Checked)
                {
                    logCheckes.Add(logcatList[i]);
                }
            }
            //利用list 中 sort排序, 自定义排序方法
            logCheckes.Sort(Compare);
            CombineFile(logCheckes, WelcomeForm.logDirPath + "\\LOGANALYSIS");

            for (int i = 0; i < logCheckes.Count; i++)
            {
                Console.WriteLine(logCheckes[i].name + "----" + logCheckes[i].startTime);
            }

            WelcomeForm.logFileName = WelcomeForm.logDirPath + "\\LOGANALYSIS";
            //分析log,打开新窗口
            LOGDLL.LogResult[] myLog = LOGDLL.Analysis(WelcomeForm.logDirPath + "\\LOGANALYSIS");
            Form logAnalysisForm = new LogAnalysis(myLog);
            logAnalysisForm.Show();
            this.Close();

            //处理kernel log
            String kernelLogPath = Utils.IOHelper.FindFileInDir(WelcomeForm.logDirPath, "dmesglog");
            //EventListView.Execute(Application.StartupPath + @"\dmesgtime.exe " + "\"" + kernelLogPath + "\"" + " 1", 1);
            EventListView.Execute("dmesgtime.exe", "\"" + kernelLogPath + "\" 1");
        }