Windows服务的应用程序设置 [英] Application Settings for a Windows Service

查看:81
本文介绍了Windows服务的应用程序设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我正在编写一个将在Windows服务器上运行的应用程序,该服务器将跟踪事物并且每隔一段时间就会唤醒并经常运行一两个程序将通过网络发送信息。



我的问题是我在哪里存储设置配置的值?如果我使用注册表,我将需要更高的权限来存储信息。如果我使用app.config是应用程序可用的信息,即使没有人登录到服务器?我目前没有Windows服务器来测试它。



谢谢,

格伦

Hi,

I'm writing an application that will run on a Windows Server that will keep track for things and wake up every so often passing and running a program or two that will send information across the network.

My question is where do I store the values of the setup configuration? If I use the registry, I will need a higher privilege to store the information there. If I use app.config is the information available to the application even if nobody signs on to the server? I currently do not have a Windows Server to test this on.

Thank you,
Glenn

推荐答案

Ron是对的 - app.config或文件是最好的解决方案。除非你真的需要,否则不要使用注册表 - 它在旧时代被严重滥用,现在访问受到限制,并且随着时间的推移可能会受到更多限制。



就个人而言,我在打开文件夹中使用我自己的文件 - 这可能会有所帮助:我应该在哪里存储我的数据? [ ^ ]
Ron is right - app.config or a file is the best solution. Don't use the registry for anything unless you really have to - it was badly abused in the "old days" and access is now restricted, and likely to get more restricted as time goes on.

Personally, I'd use my own file in a "open" folder - this might help: Where should I store my data?[^]


这篇关于Windows服务的应用程序设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆