예제 #1
0
        public static string command(string cmd)
        {
            Process expr_05 = new Process();

            expr_05.StartInfo.FileName               = "cmd.exe";
            expr_05.StartInfo.WorkingDirectory       = ".";
            expr_05.StartInfo.UseShellExecute        = false;
            expr_05.StartInfo.RedirectStandardInput  = true;
            expr_05.StartInfo.RedirectStandardOutput = true;
            expr_05.StartInfo.RedirectStandardError  = true;
            expr_05.StartInfo.CreateNoWindow         = true;
            expr_05.Start();
            string outputFile = VirtualHereUtil.getOutputFile();

            expr_05.StandardInput.WriteLine(cmd + " -r " + outputFile);
            expr_05.StandardInput.AutoFlush = true;
            expr_05.Close();
            expr_05.Dispose();
            Thread.Sleep(1000);
            return(VirtualHereUtil.readTextFile(outputFile));
        }
예제 #2
0
        public static void connectControl()
        {
            VirtualHereUtil.openAutoFind();
            Process expr_0A = new Process();

            expr_0A.StartInfo.FileName               = "cmd.exe";
            expr_0A.StartInfo.WorkingDirectory       = ".";
            expr_0A.StartInfo.UseShellExecute        = false;
            expr_0A.StartInfo.RedirectStandardInput  = true;
            expr_0A.StartInfo.RedirectStandardOutput = true;
            expr_0A.StartInfo.RedirectStandardError  = true;
            expr_0A.StartInfo.CreateNoWindow         = true;
            expr_0A.Start();
            string outputFile = VirtualHereUtil.getOutputFile();

            expr_0A.StandardInput.WriteLine("tpui64.exe -t \"AUTO USE DEVICE PORT,tpcast.1121\" -r " + outputFile);
            expr_0A.StandardInput.WriteLine("tpui64.exe -t \"AUTO USE DEVICE PORT,tpcast.1127\" -r " + outputFile);
            expr_0A.StandardInput.WriteLine("tpui64.exe -t \"AUTO USE DEVICE PORT,tpcast.1126\" -r " + outputFile);
            expr_0A.StandardInput.WriteLine("tpui64.exe -t \"AUTO USE DEVICE PORT,tpcast.1125\" -r " + outputFile);
            expr_0A.StandardInput.AutoFlush = true;
            expr_0A.Close();
        }