using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.ServiceProcess;
namespace te
{
public partial class Form1 : Form
{
private ServiceController sc = new ServiceController("HTTPFilter", Environment.MachineName);
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
this.sc.Start();
}
private void button2_Click(object sender, EventArgs e)
{
this.sc.Stop();
}
private void Form1_Load(object sender, EventArgs e)
{
textBox1.Text = sc.Status.ToString()+ sc.MachineName.ToString();
}
}
}
اگه بتونم بيشتر كمكت كنم خيلي خوشحال ميشم