当前位置:软件学习 > 其它软件 >>

安装Windows服务时出现异常 索引和长度必须引用该字符串内的位置 参数名:Length

本人在VS中建立了一个服务,但在安装是出现如上问题,请问如何解决?代码如下:   
//ServiceName       =       "Service1   "   
namespace       WindowsService2   
{   
                public       partial       class       Service1       :       ServiceBase   
                {   
                                public       Service1()   
                                {   
                                                InitializeComponent();   
                                }   

                                protected       override       void       OnStart(string[]       args)   
                                {   
                                                //       TODO:       在此处添加代码以启动服务。   
                                                Process.Start(   "notepad.exe   ");   
                                }   

                                protected       override       void       OnStop()   
                                {   
                                                //       TODO:       在此处添加代码以执行停止服务所需的关闭操作。   
                                }   
                }   
}   
补充:企业软件 ,  企业信息化
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,