如何在用户尝试启动/停止Windows服务时添加进度条

时间:2011-12-29 10:44:30

标签: wpf c#-4.0 progress-bar

`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);   
        }
    }`

我有一个启动和停止服务的项目。大多数时候它很快但有时却不是。所以我想告诉用户正在执行的功能

0 个答案:

没有答案