netmonitor/NetMonitorClient/ServiceControl.cs

50 lines
1.4 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceProcess;
using System.Net.Sockets;
using System.Net;
namespace NetMonitorClient
{
class ServiceControl
{
private UdpClient client;
private IPEndPoint rep; //remoteEndPoint
public ServiceControl(string name)
{
ServiceController sc = new ServiceController();
sc.ServiceName = name;
//if (sc.Status != ServiceControllerStatus.Running)
//{
// sc.Start();
//}
this.client = new UdpClient();
this.rep = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 34523);
}
internal void setNetworkAuto()
{
byte[] data = Encoding.UTF8.GetBytes("NET AUTO");
this.client.Send(data, data.Length, this.rep);
//throw new NotImplementedException();
}
internal void setNetworkIp(string ip, string subnet, string gateway)
{
throw new NotImplementedException();
}
internal void setNetworkDNS(string dns)
{
throw new NotImplementedException();
}
internal void setNetworkWINS(string wins)
{
throw new NotImplementedException();
}
}
}