fkheng Posted May 18, 2003 Posted May 18, 2003 I started off a .NET project by choosing it at the wizard as a Windows Application. However, I now think that I would like it to be a Windows Service. Is there any way I can convert it to a windows service? Quote Can you bind the beautiful Pleiades, and can you loose the cords of Orion? - God to Job...
Guest mutant Posted May 18, 2003 Posted May 18, 2003 You could inherit your main class from ServiceBase, add OnStart method, and OnStop. But it wont be that easy :), because i think youll have to change some otehr things too. Quote
fkheng Posted May 18, 2003 Author Posted May 18, 2003 er........i don't really uinderstand wat u mean, i'm actually still a newbie, could you elaborate a bit more for me? Quote Can you bind the beautiful Pleiades, and can you loose the cords of Orion? - God to Job...
Guest mutant Posted May 18, 2003 Posted May 18, 2003 Im assuming you have a form class. Go to the top of it, you should see this: Inherits Windows.Forms.Form Change it to: Inherits System.ServiceProcess.ServiceBase This will make it a service. Now, you need to override the OnStart and OnStop. Protected Overrides Sub OnStart(ByVal args() As String) 'in here you put the code that tells the service what to do End Sub Protected Overrides Sub OnStop() 'tells the service what to do when it stops End Sub From there you just call your methods, functions, or whatever you call :) Quote
fkheng Posted May 18, 2003 Author Posted May 18, 2003 i see, thanx, i'll try first! Quote Can you bind the beautiful Pleiades, and can you loose the cords of Orion? - God to Job...
fkheng Posted May 18, 2003 Author Posted May 18, 2003 i get an error message stating "Type System.ServiceProcess.ServiceBase" not defined, wat does this mean? Quote Can you bind the beautiful Pleiades, and can you loose the cords of Orion? - God to Job...
fkheng Posted May 18, 2003 Author Posted May 18, 2003 do i have to add any reference? Quote Can you bind the beautiful Pleiades, and can you loose the cords of Orion? - God to Job...
fkheng Posted May 18, 2003 Author Posted May 18, 2003 okok, sorry, i had to add the service process reference... Quote Can you bind the beautiful Pleiades, and can you loose the cords of Orion? - God to Job...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.