C#Windows服务 - 设置服务登录 [英] C# Windows Service - Set service login

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

问题描述

您好,



我正在构建一个Windows服务,它可以检索有关不同硬件的信息,然后将信息存储在数据库中,此时该部分完成后我试图在不同的计算机上安装该服务,我想知道安装过程中弹出的小窗口是否可以在这些文本框中设置一些默认值。



提前致谢。



最好的问候。

解决方案

我相信您可以通过修改ProjectInstaller.Designer.cs文件并修改InitializeComponent方法中的以下行来实现:



  this  .serviceProcessInstaller1.Password =  null ; 
.serviceProcessInstaller1.Username = null ;


也许这个主题可以帮到你: http://stackoverflow.com/questions/140054/using-installutil-and-silently-setting-a-windows-service-logon-username-password [ ^ ]

Hello,

I'm building a windows service that retrieves information about diferent hardware, and after that it stores the information in a database, right now that part is done and im trying to install that service in diferent computers, and i wanted to know if the little window that pops up during the installation, called Set Service login, is possible to set some default values in those textboxes.

Thanks in advance.

Best Regards.

解决方案

I believe you can do it by modifying your ProjectInstaller.Designer.cs file and modifying the following lines in the InitializeComponent method:

this.serviceProcessInstaller1.Password = null;
this.serviceProcessInstaller1.Username = null;


Perhaps this thread would help you: http://stackoverflow.com/questions/140054/using-installutil-and-silently-setting-a-windows-service-logon-username-password[^]


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

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