Please experts explain this C # program, which is a windows service ServiceBase base class, SmsService is

Please experts explain this C # program, which is a windows service ServiceBase base class, SmsService is

a subclass of ServiceBase.

the Main void static ()
{
the ServiceBase [] ServicesToRun;
ServicesToRun the ServiceBase new new = []
{
new new SMSService ()
};
ServiceBase.Run (ServicesToRun);
}

Satisfactory answer

The adoption rate: 53% 9 2014.04.05
ServiceBase [] ServicesToRun; // initialize parent array
ServicesToRun = new ServiceBase [] {new SmsService ()}; // instantiate the array, the array only a subclass instance element
ServiceBase.Run (ServicesToRun); // call run method parent class, sub-class parameter , the function is run subclass instance

Guess you like

Origin www.cnblogs.com/bwdblogs/p/11713304.html