如何在 C# WPF 应用程序启动时自动启动 MySQL 服务器? 我正在使用 xampp。我想在应用程序启动时自动启动xampp然后启动MySQL,如何实现? 我试过这个:
ServiceController controller = new ServiceController();
controller.MachineName = ".";
controller.ServiceName = "mysql";
// Start the service
controller.Start();
但它不起作用,因为它说mysql服务不存在。