【发布时间】:2012-12-06 12:29:30
【问题描述】:
当我使用命令提示符以如下所示的方式安装服务时,我正在尝试将参数传递给 Windows 服务
d:\mypath>installutil -i service.exe -参数
在 program.cs 文件中安装之前,我已经按照以下方式编写了
static void Main(string[] args)
{
**string path = args[0];**
ServiceBase[] ServicesToRun;
ServicesToRun = new ServiceBase[]
{
**new VibrantEmail(path)**
};
ServiceBase.Run(ServicesToRun);
}
在 service.cs 页面中我已经写了这个
**public VibrantEmail(string path)**
{
**data = path**
InitializeComponent();
}
事情就像我使用 static void Main(string[] args) 在 program.cs 页面中,只有我收到此错误,编号 1053。 谁能帮帮我?
【问题讨论】: