`private void btnStartServerIns_Click(object sender, RoutedEventArgs e)
{
try
{
ServiceController sc = new ServiceController("RMExSoftphoneService");
if ((sc.Status.Equals(ServiceControllerStatus.Stopped)))
{
sc.Start();
LogDebug("Starting the RMExSoftphoneServer");
}
LogDebug("Started the RMExSoftphoneServer");
}
catch (Exception Ex)
{
LogDebug(Ex.Message);
}
}`
我有一个启动和停止服务的项目。大多数时候它很快但有时却不是。所以我想告诉用户正在执行的功能