using System;
using System.IO;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
namespace ServerRestart
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void helpToolStripMenuItem1_Click(object sender, EventArgs e)
{
MessageBox.Show("Step 1. Name your bat files. In the provided textboxes. Input the name of the bat files. (e.g If your first bat to be launched is world.bat, put world.bat");
MessageBox.Show("OPTIONAL: State the time you want in between bat files launched.");
MessageBox.Show("Step 2. Click the 'Start Server' button. ");
MessageBox.Show("If at anytime you want to shut down, click the 'Close Server' button. To restart, click the 'Restart Server' button.");
}
private void button3_Click(object sender, EventArgs e)
{
richTextBox1.Text = "";
}
private void button1_Click(object sender, EventArgs e)
{
Process startServer = new Process();
startServer.StartInfo.FileName = "serverstart.bat";
startServer.Start();
richTextBox1.Text = richTextBox1.Text + DateTime.Today.ToString("MM/dd/yyyy") + (" - All instances of server are running. (Java)\r\n");
}
private void button2_Click(object sender, EventArgs e)
{
Process startServer = new Process();
startServer.StartInfo.FileName = "serverstart";
startServer.Kill();
richTextBox1.Text = richTextBox1.Text + DateTime.Today.ToString("MM/dd/yyyy") + (" - All instaces of server have been stopped. (Java)\r\n");
}
private void button4_Click(object sender, EventArgs e)
{
Process startServer = new Process();
startServer.StartInfo.FileName = "serverstart.bat";
startServer.Kill();
richTextBox1.Text = richTextBox1.Text + DateTime.Today.ToString("MM/dd/yyyy") + (" - All instaces of server have been stopped. (Java)\r\n");
startServer.Start();
richTextBox1.Text = richTextBox1.Text + DateTime.Today.ToString("MM/dd/yyyy") + (" - All instances of server are running. (Java)\r\n");
}
private void button5_Click(object sender, EventArgs e)
{
Process startServer = new Process();
startServer.StartInfo.FileName = "Maplestoryserver.exe";
startServer.Start();
}
private void button7_Click(object sender, EventArgs e)
{
Process startServer = new Process();
startServer.StartInfo.FileName = "Maplestoryserver.exe";
startServer.Kill();
}
private void button6_Click(object sender, EventArgs e)
{
Process startServer = new Process();
startServer.StartInfo.FileName = "Maplestoryserver.exe";
startServer.Kill();
startServer.Start();
}
private void setAutoRestartToolStripMenuItem_Click(object sender, EventArgs e)
{
Form2 restarttime = new Form2();
restarttime.Show();
}
private void timer1_Tick(object sender, EventArgs e)
{
Process startServer = new Process();
startServer.StartInfo.FileName = "serverstart.bat";
startServer.Kill();
richTextBox1.Text = richTextBox1.Text + DateTime.Today.ToString("MM/dd/yyyy") + (" - All instaces of server have been stopped. (Java)\r\n");
startServer.Start();
richTextBox1.Text = richTextBox1.Text + DateTime.Today.ToString("MM/dd/yyyy") + (" - All instances of server are running. (Java)\r\n");
}
private void button8_Click(object sender, EventArgs e)
{
timer1.Interval = int.Parse(textBox1.Text);
timer1.Start();
}
private void creditsToolStripMenuItem1_Click(object sender, EventArgs e)
{
Form2 credits = new Form2();
credits.Show();
}
private void visitSoyDEVToolStripMenuItem_Click(object sender, EventArgs e)
{
Process.Start("http://soy.no-ip.biz/");
}
private void calculatorToolStripMenuItem_Click(object sender, EventArgs e)
{
Process.Start("calc.exe");
}
private void tabPage1_Click(object sender, EventArgs e)
{
}
}
}