else if (this.Mode == TravelMode.AutoRecodeMode) 
            {
                DateTime StartDate = DateTime.Now;
                string args = string.Format(" -jar \"{4}\" {0} {1} {2} {3}",
                this.SerialNumber, this.ScreenSize.Width, this.ScreenSize.Height, this.PackageName, jarLocation);
                //string args = @"-jar " +@"\E:\1010NewAppTest\bin\Debug\adb\TraversalApp.jar"+ " IJAEZ9INS8EUHMVK 720 1280 com.android.calculator2";

#if DEBUG
                System.Console.WriteLine(string.Format("[AndroidTraveler] ExecuteScript() -> AutoRecodeMode Args:{0}", args));
#endif
                //声明一个程序信息类
                System.Diagnostics.ProcessStartInfo Info = new System.Diagnostics.ProcessStartInfo();
                //设置外部程序名
                Info.FileName = "java.exe";
                Info.RedirectStandardInput = true;
                Info.UseShellExecute = false;
                Info.Arguments = args;
                //声明一个程序类
                System.Diagnostics.Process Proc;
                try
                {
                    //启动外部程序   
                    Proc = System.Diagnostics.Process.Start(Info);
                    Proc.WaitForExit();
                }
                catch (System.ComponentModel.Win32Exception exc)
                {
                    Console.WriteLine("系统找不到指定的程序文件。\r{0}", exc);
                }               

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-06
  • 2022-12-23
  • 2021-07-24
  • 2021-04-12
  • 2022-12-23
猜你喜欢
  • 2022-02-07
  • 2022-02-27
  • 2022-12-23
  • 2021-07-23
  • 2022-12-23
  • 2022-12-23
  • 2023-01-09
相关资源
相似解决方案