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();
 }