或者通过如下的方式试试: Assembly assService = Assembly.GetExecutingAssembly(); // Get file full name using "assService.Location"
it does work, thx pal
AppDomain.CurrentDomain.SetupInformation.ConfigurationFile : To get the full path of windows service ConfigurationFile file AppDomain.CurrentDomain.SetupInformation.ApplicationBase : To get the path current service
Assembly assService = Assembly.GetExecutingAssembly();
// Get file full name using "assService.Location"
AppDomain.CurrentDomain.SetupInformation.ApplicationBase : To get the path current service