윈도우즈 서비스에서


System.Environment.CurrentDirectory 을 호출하면 "C:\Windows\System32"를 카리킨다.


그럴때 두가지 방법이 있다.


1. System.Windows.Forms 을 참조하고 System.Windows.Forms.Application.StartupPath을 호출


2. System.Reflection.Assembly.GetEntryAssembly().Location



'.Net > .Net' 카테고리의 다른 글

[.Net] 닷넷프레임워크 버전 확인  (0) 2013.05.10
[.Net] TransactedInstaller  (0) 2013.04.22
[.Net] Changing Start Mode of a Windows Service  (0) 2013.04.20
[.Net] Mutex 클래스  (0) 2013.04.19
[.Net] ServiceController  (0) 2013.04.18
posted by 뚱2