This class can launch a process (like a bat file, perl script, etc) and return all of the StdOut and StdErr to GUI app for display in textboxes, etc.
This class (c) 2003 Michael Mayer Use it as you like (public domain licensing). Please post any bugs / fixes to the page where you downloaded this code.
Inheritance: System.ComponentModel.AsyncOperation
コード例 #1
0
 //
 // Process Utility Server Starts
 //
 public void conserver()
 {
     connectionserver = new ProcessCaller(this);
     connectionserver.FileName = "connectionserver.exe";
     connectionserver.WorkingDirectory = "";
     connectionserver.Arguments = "";
     connectionserver.StdErrReceived += new DataReceivedHandler(writeConnStreamInfo);
     connectionserver.StdOutReceived += new DataReceivedHandler(writeConnStreamInfo);
     connectionserver.Completed += new EventHandler(connectionCompleted);
     connectionserver.Cancelled += new EventHandler(connectionCanceled);
     connectionserver.Start();
     //flgConnection = true;
 }
コード例 #2
0
 public void zonecorellia()
 {
     corelliazone = new ProcessCaller(this);
     corelliazone.FileName = "zoneserver.exe";
     corelliazone.WorkingDirectory = "";
     corelliazone.Arguments = "corellia";
     corelliazone.StdErrReceived += new DataReceivedHandler(writeCorelliaStreamInfo);
     corelliazone.StdOutReceived += new DataReceivedHandler(writeCorelliaStreamInfo);
     corelliazone.Completed += new EventHandler(corelliaCompleted);
     corelliazone.Cancelled += new EventHandler(corelliaCanceled);
     corelliazone.Start();
     //flgCorelliaStarted = true;
 }
コード例 #3
0
 private void tatooineCanceled(object sender, EventArgs e)
 {
     txtTatooine.AppendText("TAtooine Stopped by user.\n");
     tatooinezone = null;
 }
コード例 #4
0
 private void talusCanceled(object sender, EventArgs e)
 {
     txtTalus.AppendText("Talus Stopped by user.\n");
     taluszone = null;
 }
コード例 #5
0
 private void pingCompleted(object sender, EventArgs e)
 {
     txtPing.AppendText("Ping Server crashed.\n");
     pingserver = null;
     Thread AnhRestart = new Thread(new ThreadStart(RestartANH));
     if (flgRestartAnh == true)
     {
         AnhRestart.Abort();
         flgRestartAnh = false;
     }
     AnhRestart.Start();
 }
コード例 #6
0
 //
 //Login Server
 //
 private void loginCanceled(object sender, EventArgs e)
 {
     txtLogin.AppendText("Login Server Exited.\n");
     loginserver = null;
 }
コード例 #7
0
 private void nabooCanceled(object sender, EventArgs e)
 {
     txtNaboo.AppendText("Naboo Stopped by user.\n");
     naboozone = null;
 }
コード例 #8
0
 //ZONES
 public void zonetutorial()
 {
     tutorialzone = new ProcessCaller(this);
     tutorialzone.FileName = "zoneserver.exe";
     tutorialzone.WorkingDirectory = "";
     tutorialzone.Arguments = "tutorial";
     tutorialzone.StdErrReceived += new DataReceivedHandler(writeTutorialStreamInfo);
     tutorialzone.StdOutReceived += new DataReceivedHandler(writeTutorialStreamInfo);
     tutorialzone.Completed += new EventHandler(tutorialCompleted);
     tutorialzone.Cancelled += new EventHandler(tutorialCanceled);
     tutorialzone.Start();
        // flgTutorialStarted = true;
 }
コード例 #9
0
 public void zoneyavin()
 {
     yavinzone = new ProcessCaller(this);
     yavinzone.FileName = "zoneserver.exe";
     yavinzone.WorkingDirectory = "";
     yavinzone.Arguments = "yavin4";
     yavinzone.StdErrReceived += new DataReceivedHandler(writeYavinStreamInfo);
     yavinzone.StdOutReceived += new DataReceivedHandler(writeYavinStreamInfo);
     yavinzone.Completed += new EventHandler(yavinCompleted);
     yavinzone.Cancelled += new EventHandler(yavinCanceled);
     yavinzone.Start();
     //flgYavinStarted = true;
 }
コード例 #10
0
 public void zonenaboo()
 {
     naboozone = new ProcessCaller(this);
     naboozone.FileName = "zoneserver.exe";
     naboozone.WorkingDirectory = "";
     naboozone.Arguments = "naboo";
     naboozone.StdErrReceived += new DataReceivedHandler(writeNabooStreamInfo);
     naboozone.StdOutReceived += new DataReceivedHandler(writeNabooStreamInfo);
     naboozone.Completed += new EventHandler(nabooCompleted);
     naboozone.Cancelled += new EventHandler(nabooCanceled);
     naboozone.Start();
     //flgNabooStarted = true;
 }
コード例 #11
0
 public void zonerori()
 {
     rorizone = new ProcessCaller(this);
     rorizone.FileName = "zoneserver.exe";
     rorizone.WorkingDirectory = "";
     rorizone.Arguments = "rori";
     rorizone.StdErrReceived += new DataReceivedHandler(writeRoriStreamInfo);
     rorizone.StdOutReceived += new DataReceivedHandler(writeRoriStreamInfo);
     rorizone.Completed += new EventHandler(roriCompleted);
     rorizone.Cancelled += new EventHandler(roriCanceled);
     rorizone.Start();
     //flgRoriStarted = true;
 }
コード例 #12
0
 public void zonelok()
 {
     lokzone = new ProcessCaller(this);
     lokzone.FileName = "zoneserver.exe";
     lokzone.WorkingDirectory = "";
     lokzone.Arguments = "lok";
     lokzone.StdErrReceived += new DataReceivedHandler(writeLokStreamInfo);
     lokzone.StdOutReceived += new DataReceivedHandler(writeLokStreamInfo);
     lokzone.Completed += new EventHandler(lokCompleted);
     lokzone.Cancelled += new EventHandler(lokCanceled);
     lokzone.Start();
     //flgLokStarted = true;
 }
コード例 #13
0
 public void zoneendor()
 {
     endorzone = new ProcessCaller(this);
     endorzone.FileName = "zoneserver.exe";
     endorzone.WorkingDirectory = "";
     endorzone.Arguments = "endor";
     endorzone.StdErrReceived += new DataReceivedHandler(writeEndorStreamInfo);
     endorzone.StdOutReceived += new DataReceivedHandler(writeEndorStreamInfo);
     endorzone.Completed += new EventHandler(endorCompleted);
     endorzone.Cancelled += new EventHandler(endorCanceled);
     endorzone.Start();
     //flgEndorStarted = true;
 }
コード例 #14
0
 public void zonedathomir()
 {
     dathomirzone = new ProcessCaller(this);
     dathomirzone.FileName = "zoneserver.exe";
     dathomirzone.WorkingDirectory = "";
     dathomirzone.Arguments = "dathomir";
     dathomirzone.StdErrReceived += new DataReceivedHandler(writeDathomirStreamInfo);
     dathomirzone.StdOutReceived += new DataReceivedHandler(writeDathomirStreamInfo);
     dathomirzone.Completed += new EventHandler(dathomirCompleted);
     dathomirzone.Cancelled += new EventHandler(dathomirCanceled);
     dathomirzone.Start();
     //flgDathomirStarted = true;
 }
コード例 #15
0
 //
 //Dathomir
 //
 private void dathomirCompleted(object sender, EventArgs e)
 {
     txtDathomir.AppendText("Dantooine Crash.\n");
     dathomirzone = null;
     Thread AnhRestart = new Thread(new ThreadStart(RestartANH));
     if (flgRestartAnh == true)
     {
         AnhRestart.Abort();
         flgRestartAnh = false;
     }
     AnhRestart.Start();
 }
コード例 #16
0
 //
 //Chat Server
 //
 private void chatCanceled(object sender, EventArgs e)
 {
     txtChat.AppendText("Chat Server Exited.\n");
     chatserver = null;
 }
コード例 #17
0
 private void endorCanceled(object sender, EventArgs e)
 {
     txtEndor.AppendText("Endor Stopped by user.\n");
     endorzone = null;
 }
コード例 #18
0
 //
 //Connection Server
 //
 private void connectionCanceled(object sender, EventArgs e)
 {
     txtConnection.AppendText("ConnectionServer Exited.\n");
        connectionserver = null;
 }
コード例 #19
0
 private void lokCanceled(object sender, EventArgs e)
 {
     txtLok.AppendText("Lok Stopped by user.\n");
     lokzone = null;
 }
コード例 #20
0
 private void connectionCompleted(object sender, EventArgs e)
 {
     txtConnection.AppendText("ConnectionServer crashed.\n");
     connectionserver = null;
     Thread AnhRestart = new Thread(new ThreadStart(RestartANH));
     if (flgRestartAnh == true)
     {
         AnhRestart.Abort();
         flgRestartAnh = false;
     }
     AnhRestart.Start();
 }
コード例 #21
0
 //
 //Ping Server
 //
 private void pingCanceled(object sender, EventArgs e)
 {
     txtPing.AppendText("Ping Server Exited.\n");
     pingserver = null;
 }
コード例 #22
0
 private void corelliaCanceled(object sender, EventArgs e)
 {
     txtCorellia.AppendText("Corellia Stopped by user.\n");
     corelliazone = null;
 }
コード例 #23
0
 private void roriCanceled(object sender, EventArgs e)
 {
     txtRori.AppendText("Rori Stopped by user.\n");
     rorizone = null;
 }
コード例 #24
0
 //
 //Corellia
 //
 private void corelliaCompleted(object sender, EventArgs e)
 {
     txtCorellia.AppendText("Corellia Crash.\n");
     corelliazone = null;
     Thread AnhRestart = new Thread(new ThreadStart(RestartANH));
     if (flgRestartAnh == true)
     {
         AnhRestart.Abort();
         flgRestartAnh = false;
     }
     AnhRestart.Start();
 }
コード例 #25
0
 //
 //Rori
 //
 private void roriCompleted(object sender, EventArgs e)
 {
     txtRori.AppendText("Rori Crash.\n");
     rorizone = null;
     Thread AnhRestart = new Thread(new ThreadStart(RestartANH));
     if (flgRestartAnh == true)
     {
         AnhRestart.Abort();
         flgRestartAnh = false;
     }
     AnhRestart.Start();
 }
コード例 #26
0
 private void dantooineCanceled(object sender, EventArgs e)
 {
     txtDantooine.AppendText("Dantooine Stopped by user.");
     dantooinezone = null;
 }
コード例 #27
0
 public void logserver()
 {
     loginserver = new ProcessCaller(this);
     loginserver.FileName = "loginserver.exe";
     loginserver.WorkingDirectory = "";
     loginserver.Arguments = "";
     loginserver.StdErrReceived += new DataReceivedHandler(writeLoginStreamInfo);
     loginserver.StdOutReceived += new DataReceivedHandler(writeLoginStreamInfo);
     loginserver.Completed += new EventHandler(loginCompleted);
     loginserver.Cancelled += new EventHandler(loginCanceled);
     loginserver.Start();
        // flgLogin = true;
 }
コード例 #28
0
 private void dathomirCanceled(object sender, EventArgs e)
 {
     txtDathomir.AppendText("Dathomir Stopped by user.\n");
     dathomirzone = null;
 }
コード例 #29
0
 //
 //Tatooine
 //
 private void tatooineCompleted(object sender, EventArgs e)
 {
     txtTatooine.AppendText("Tatooine Crash.\n");
     tatooinezone = null;
     Thread AnhRestart = new Thread(new ThreadStart(RestartANH));
     if (flgRestartAnh == true)
     {
         AnhRestart.Abort();
         flgRestartAnh = false;
     }
     AnhRestart.Start();
 }
コード例 #30
0
 //
 //Yavin 4
 //
 private void yavinCompleted(object sender, EventArgs e)
 {
     txtEndor.AppendText("Yavin 4 Crash.\n");
     yavinzone = null;
     Thread AnhRestart = new Thread(new ThreadStart(RestartANH));
     if (flgRestartAnh == true)
     {
         AnhRestart.Abort();
         flgRestartAnh = false;
     }
     AnhRestart.Start();
 }