?????????????????????????????y?????????顣
????1 string path = Directory.GetCurrentDirectory() + "/config.ini";
????2 List<string> serviceGroups = INIHelper.GetAllSectionNames(path);
????3 cboServiceGroup.DataSource = serviceGroups;
???????е?INI???????ο??????http://www.cnblogs.com/mahongbiao/p/3751153.html
?????????????????????????System.ServiceProcess??????
????????????飺

1 if (string.IsNullOrEmpty(cboServiceGroup.Text))
2 {
3     MessageBox.Show("?????????????????");
4     return;
5 }
6 //
7 string path = Directory.GetCurrentDirectory() + "/config.ini";
8 string section = cboServiceGroup.Text;
9 string[] keys;
10 string[] values;
11 INIHelper.GetAllKeyValues(section?? out keys?? out values?? path);
12 //
13 foreach (string value in values)
14 {
15     ServiceController sc = new ServiceController(value);
16     //
17     try
18     {
19         ServiceControllerStatus scs = sc.Status;
20         if (scs != ServiceControllerStatus.Running)
21         {
22             try
23             {
24                 sc.Start();
25             }
26             catch (Exception ex)
27             {
28                 MessageBox.Show("?????????? " + ex.ToString());
29             }
30         }
31     }
32     catch (Exception ex)
33     {
34         MessageBox.Show("?????????" + value);
35     }
36     //
37 }
38 //
39 MessageBox.Show("??????????");
 
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????