如何从前端/用户界面更改Windows服务的app.config文件 [英] how to alter app.config File of windows Service from Front End/user Interface

查看:198
本文介绍了如何从前端/用户界面更改Windows服务的app.config文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开发了Windows服务
和一个ServiceController
在系统任务栏图标中显示.
其中包含Sart/Stop选项以更改
的状态 服务.

在这里,我想在菜单中添加一个功能,如
设置.当用户单击设置时
打开一个窗口以输入一些时间输入
表示1小时2小时或特定时间,例如10Am或任何时间.
当用户获取值后单击确定"时.

我希望在App.config xml文件中,参数应该
通过那里并相应地更改配置文件.
如何实现这一目标.
能做到吗
请提出一些建议.

I have Developed a Windows Service
and a ServiceController
which shows in system Tray Icon.
which contains Sart/Stop options to Alter the state of
the Service.

Here I want to add a functionality in the menu like
setting .When user clicks the settings
a window opens to input some Time inputs
means 1 hour 2 hour or a Specific time Like 10Am or any.
when user clicks ok after enetring the value.

I want that in The App.config xml file the parameters should
pass there and changes the configuration File Accordingly.
How to achieve this.
Can this Be done
Please suggest some Idea.

推荐答案


右键单击您的解决方案,然后依次选择属性"和设置",您可以在app.config中添加变量,并访问此
使用C#
Hi ,
Right click on your solution Choose Properties Then Settings now you can add your variable in app.config and to access this
using C#
string x = Properties.Settings.Default.Myvariable;


部署应用程序后,请去设置文件并对其进行修改
最好的问候
米特瓦里(M.Mitwalli)


after you deploy your application go to set up file and modified it
Best Regards
M.Mitwalli


这篇关于如何从前端/用户界面更改Windows服务的app.config文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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