c#的windows service 怎么取当前exe的路径
windows service 不能用
directory.getcurrentdirectiry()
取当前路径,
正确的方法是
var location = System.Reflection.Assembly.GetEntryAssembly().Location;
var directoryPath = Path.GetDirectoryName(location);
windows service 不能用
directory.getcurrentdirectiry()
取当前路径,
正确的方法是
var location = System.Reflection.Assembly.GetEntryAssembly().Location;
var directoryPath = Path.GetDirectoryName(location);