日期:2014-05-16  浏览次数:20780 次

利用WebService技术在客户端调用服务器端的可执行文件
大家好,急需如何在客户端来调用服务器端的可执行程序例如.exe文件,并在客户端显示执行的解决办法,先谢谢各位的支持!!!

------解决方案--------------------
新建一个服务
C# code
protected void btnAppStart_Click(object sender, EventArgs e)
    {
        
        
        ServiceController SVS = new ServiceController(); 
        SVS.ServiceName = "SubSystemControl"; 
        if (SVS.Status == ServiceControllerStatus.Stopped)
        { 
            string[] args=new string[2]; 
            args[0] = txt_AppAddress.Value ;
            args[1] = "";
            SVS.Start(args); 
        }
        if (SVS.Status == ServiceControllerStatus.Running)
        {
            SVS.Stop();
        }
    } 
   
    protected void btnAppEnd_Click(object sender, EventArgs e)
    {
        ServiceController SVS = new ServiceController();
        SVS.ServiceName = "SubSystemControl";
        if (SVS.Status == ServiceControllerStatus.Running)
        {
            string[] args = new string[2];
            args[0] = txt_AppAddress.Value;
            args[1] = "";
            SVS.Stop();
        }
    }