Sorry, I misunderstood the post.   You should create a page that calls this
function and pass in the name of the Service Process, if this method works
as advertised.
Something like


//StartCF.aspx.vb
//-------------------

imports System.ServiceProcess;
imports System...

public void Page_Load (object sender, System.EventArgs e)
{
        StartService("ColdFusion"); // Use the name of the CF service 
}


public static void StartService(string strServiceName)
{
   System.ServiceProcess.ServiceController sc2 =
         new System.ServiceProcess.ServiceController(strServiceName,  ".");
   
    if 
(sc2.Status.Equals(System.ServiceProcess.ServiceControllerStatus.Stopped))
    {
      sc2.Start();
    }
}



Matthew Small
Web Developer
American City Business Journals
704-973-1045
[EMAIL PROTECTED]
 

-----Original Message-----
From: Ken Ferguson [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 13, 2005 12:58 PM
To: CF-Talk
Subject: starting CF with ASP.NET

So, now that I have these great utilities to zip up my directories it'd 
be nice if the CF server was actually running. I've found some VB code I 
can use for this, but I don't know much about ASP.NET, so please forgive 
my ignorance, but how can I actually use this from an aspx page?

'serviceControl.vb
'-------------------
Imports System.ServiceProcess
public static void StartService(string strServiceName)
{
   System.ServiceProcess.ServiceController sc2 =
         new System.ServiceProcess.ServiceController(strServiceName,  ".");
   
    if 
(sc2.Status.Equals(System.ServiceProcess.ServiceControllerStatus.Stopped))
    {
      sc2.Start();
    }
}


Thanks,
Ferg




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:211771
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to