C#??????????????????CPU???
???????????±? ???????[ 2016/7/5 10:13:11 ] ?????????????? .NET ???
???????????????
1 public delegate void DelReadStdOutput(string result);
2 public delegate void DelReadErrOutput(string result);
3 public event DelReadStdOutput ReadStdOutput;
4 public event DelReadErrOutput ReadErrOutput;
5 /// <summary>
6 /// ??????
7 /// </summary>
8 private void Init()
9 {
10 ReadStdOutput += new DelReadStdOutput(ReadStdOutputAction);
11 ReadErrOutput += new DelReadErrOutput(ReadErrOutputAction);
12
13 }
14 //----------------------??????????==================
15 using (p = new Process())
16 {
17
18 //pause -- ??
19 p.StartInfo.FileName = fileName;
20
21 p.StartInfo.UseShellExecute = false;
22 p.StartInfo.CreateNoWindow = true;
23
24 p.StartInfo.RedirectStandardError = true;
25 p.StartInfo.RedirectStandardInput = true;
26 p.StartInfo.RedirectStandardOutput = true;
27 p.EnableRaisingEvents = true;
28 p.Exited += new EventHandler(p_Exited);
29 p.ErrorDataReceived += new DataReceivedEventHandler(p_ErrorDataReceived);
30 p.OutputDataReceived += new DataReceivedEventHandler(p_OutputDataReceived);
31
32 p.Start();
33 //????????
34 p.BeginErrorReadLine();
35 p.BeginOutputReadLine();
36 p.WaitForExit();
37 }
38
39
40 void p_OutputDataReceived(object sender?? DataReceivedEventArgs e)
41 {
42 this.lab_tips.Text = "??????????...??????????е?????????????";
43 if (e.Data != null)
44 {
45 this.Invoke(ReadStdOutput?? new object[] { e.Data });
46 }
47 }
48 // ????????????
49 public void ReadStdOutputAction(string s)
50 {
51
52 if (num > 1)
53 {
54 budiler.AppendLine(s);
55 }
56 this.textBox1.Text = budiler.ToString();
57 num++;
58 }
???????????????
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
???????C#?е?StringC# Socket???????????????????C#?????????????????????????C#???????C#????????????Log4net??????δ????C#?????????????C#?????????????????C#???????????????C#????????????????C#7 ?е?Tuple??????C#??TypeScript - GeneratorC# ?????????細(xì)??????????C#?е???н???C#??MySQL?????????μ??Ч?????д??C#????C++??dll???C#??VS2010????е??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????