[英]How can I get the ServiceName in a Windows Service written in C#?
[英]Where should I save an xml file so it can be written to by a service when Windows is logged off?
我应该在哪里保存xml文件,以便注销Windows时可以由服务(用C#编写)将其写入?
谢谢史蒂文
您可以使用隔离存储 ,但最合理的方法是Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)
因为它会将其保存在用户配置文件中的计算机上,以供运行服务的任何帐户使用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.