是否可以通过单击按钮使用C#启动XAMPP控制面板的MySQL和Apache?
提前感谢..
答案 0 :(得分:0)
我认为这是一个简单的方法:
startMySqlAndAppache_Click
)
like this Form1.cs
:<强> Form1.cs的强>
using System;
using System.Diagnostics;
using System.Windows.Forms;
namespace XAMPP_starter
{
public partial class Form1 : Form
{
private string _xamppPanelPath;
public Form1()
{
// Your absolute path to the XAMPP panel (for eg.:)
_xamppPanelPath = @"C:\xampp\xampp-control.exe";
InitializeComponent();
}
private void startMySqlAndAppache_Click(object sender, EventArgs e)
{
// Start the XAMPP Panel with this code
Process.Start(_xamppPanelPath);
}
}
}