using System.ServiceProcess;
namespace com.jk39.WindowsService.Webmd
{
static class Program
{
///
/// 應用程序的主入口點。
///
static void Main()
{
string configFilePath = GetAppPath()
+ "\\config\\log4net.config";
log4net.Config.DOMConfigurator.ConfigureAndWatch
(new System.IO.FileInfo(configFilePath));
ServiceBase[] ServicesToRun;
ServicesToRun = new ServiceBase[]
{
new WebmdService()
};
ServiceBase.Run(ServicesToRun);
}
public static string GetAppPath()
{
string myPath = System.Reflection.Assembly.
GetExecutingAssembly().Location;
int i = myPath.LastIndexOf('\');
return myPath.Remove(i + 1);
}
}
}