I'm trying to create a simple winform to run the Life is Feudal server executable on a remote machine.
The command to start the server in cmd on the server is "C:\Program Files (x86)\Steam\life is feudal\ddctd_cm_yo_server.exe" WorldDS 1
For now, I'm trying to make a simple start/stop button for it. I can figure out how to stop it later, I just want to try and get the "start" part working. I'm not quite sure where to begin with the code. All I have for the button now is: '''
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace LifeIsFeudalServerManager
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Serverstatus_Click(object sender, EventArgs e)
{
}
bool servcrtl = true;
private void ServerControl_Click(object sender, EventArgs e)
{
if (servcrtl == true)
{
servcrtl = false;
ServerControl.Text = "Stop";
}
else
{
servcrtl = true;
ServerControl.Text = "Start";
}
}
}
}
''' I'd like to add in a click event that starts the executable with the 'WorldDS1' argument on the first click, when button is displaying "start". I'd then like to add a click event that closes the process on the second click when button is displaying "stop". I'm just starting out in c# and using Visual Studios, so the simpler the better, and any help would be greatly appreciated.