private void btnStart_Click_1(object sender, EventArgs e) { //MessageBox.Show("1231231"); //int maxTemp; //int.TryParse(this.maxTemp.Text, out maxTemp); if (string.IsNullOrEmpty(this.mainEnterance.Text.Trim())) { MessageBox.Show("请输入命令"); } if (string.IsNullOrEmpty(wltAdd.Text) || string.IsNullOrEmpty(minName.Text)) { MessageBox.Show("请检查 是否有未填写的内容"); return; } else if (this.maxTemp.Text == "85") { judgementTem(); curBatSataus = BatStatus.ON; } else if (this.maxTemp.Text == "") { this.maxTemp.Text = "85"; judgementTem(); } else { int MaxTemp = Convert.ToInt32(this.maxTemp.Text); judgementTem(); } }
private void btnPrintLog_Click(object sender, EventArgs e) { stopCMD(); InitInfo(Encoding.UTF8); curProcess.StandardInput.WriteLine("adb logcat -s RxLog"); curBatSataus = BatStatus.ON; }
private void normalButtonClick(string cmd) { if (curBatSataus == BatStatus.ON) { stopCMD(); InitInfo(); } curProcess.StandardInput.WriteLine(cmd); curBatSataus = BatStatus.ON; }
private void stopCMD() { if (curProcess != null) { try { curProcess.CancelOutputRead();//取消异步操作 curProcess.Kill(); curBatSataus = BatStatus.OFF; //如果需要手动关闭,则关闭后再进行初始化 } catch { } } }
/// <summary> /// 开始命令行 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnStart_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(this.txtCommand.Text.Trim())) { MessageBox.Show("请输入命令"); } if (curBatSataus == BatStatus.ON) { stopCMD(); InitInfo(); } curProcess.StandardInput.WriteLine(this.txtCommand.Text.Trim()); curBatSataus = BatStatus.ON; }
private void btnLogFilter_Click(object sender, EventArgs e) { stopCMD(); InitInfo(Encoding.UTF8); string cmd = txtLogFilter.Text; if (string.IsNullOrEmpty(cmd)) { curProcess.StandardInput.WriteLine("adb logcat"); } else { curProcess.StandardInput.WriteLine("adb logcat | find \"" + cmd + "\""); } curBatSataus = BatStatus.ON; }