2013年10月26日

c#的windows service 怎么取当前exe的路径

摘要: windows service 不能用 directory.getcurrentdirectiry()取当前路径,正确的方法是 var location = System.Reflection.Assembly.GetEntryAssembly().Location; var directoryPath = Path.GetDirectoryName(location); 阅读全文

posted @ 2013-10-26 23:59 齐文宣 阅读(457) 评论(0) 推荐(0)

c#的windows service 为什么需要线程,老外的解释

摘要: The first time I wrote a service, I wondered whether we could do something like Listing 4, rather than go to the trouble of adding a timer. (注:我也是这么想的)Listing 4 The unstoppable service.protected override void OnStart(string[] args){ while (true) { // do some work // idle Thread.S... 阅读全文

posted @ 2013-10-26 21:58 齐文宣 阅读(725) 评论(0) 推荐(0)

导航