当前位置:编程学习 > C#/ASP.NET >>

安装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:       在此处添加代码以执行停止服务所需的关闭操作。   
                                }   
                }   
}   
补充:.NET技术 ,  VB.NET
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,