.net – Démarrer un service automatiquement

Dans le project Installer :

 

Imports System.ComponentModel

Imports System.Configuration.Install

Public Class ProjectInstaller

Public Sub New()

MyBase.New()

‘Cet appel est requis par le Concepteur de composants.

InitializeComponent()

‘Ajoutez le code d’initialisation après l’appel de InitializeComponent

End Sub

Private Sub ServiceInstaller1_AfterInstall(sender As System.Object, e As System.Configuration.Install.InstallEventArgs) Handles ServiceInstaller1.AfterInstall

Dim controller As System.ServiceProcess.ServiceController = New System.ServiceProcess.ServiceController(“transfert”)

controller.Start()

End Sub

End Class

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s