Beispiel #1
0
        public string BeginControl()
        {
            if (mProcess == null || ADBAddress.Equals(""))
            {
                return("No ADB Process");
            }
            //System.Diagnostics.Process.Start(startInfo);
            mProcess.Start();
            mProcess.StandardInput.AutoFlush = true;
            string outStr = ReadStandardOutputLine();

            Console.WriteLine(outStr);
            outStr = outStr.Replace(System.IO.Directory.GetCurrentDirectory(), "");
            return(outStr);
        }
Beispiel #2
0
        public string DoControl(string cmd)
        {
            if (mProcess == null || ADBAddress.Equals(""))
            {
                return("No ADB Process");
            }

            Console.WriteLine("begin cmd");
            mProcess.StandardInput.WriteLine(cmd);
            Console.WriteLine("end cmd");

            string outStr = ReadStandardOutputLine();

            Console.WriteLine(outStr);

            outStr = outStr.Replace(cmd, "");
            outStr = outStr.Replace(System.IO.Directory.GetCurrentDirectory(), "");
            return(outStr);
        }
Beispiel #3
0
        public string EndControl()
        {
            if (mProcess == null || ADBAddress.Equals(""))
            {
                return("No ADB Process");
            }

            mProcess.StandardInput.WriteLine("exit");
            mProcess.WaitForExit(10000);
            string outStr = mProcess.StandardOutput.ReadToEnd();

            Console.WriteLine(outStr);

            if (mProcess.StandardError.EndOfStream == false)
            {
                string error = mProcess.StandardError.ReadToEnd();
                Console.WriteLine(error);
            }

            mProcess.Close();
            //Console.WriteLine(outStr);
            outStr = outStr.Replace(System.IO.Directory.GetCurrentDirectory(), "");
            return(outStr);
        }