Я написал службу Windows, но когда я установил ее, я обнаружил, что она не работает. Я не знаю, в чем проблема!нужна помощь в обслуживании Windows
этот сервис перемещает некоторый файл из одного места в другое!
мне нужна помощь
благодаря
public partial class Service1 : ServiceBase
{
public Service1()
{
InitializeComponent();
}
protected override void OnStart(string[] args)
{
}
protected override void OnContinue()
{
const string SrcPath = "d:\\Source";
const string DisPath = "d:\\Dist\\";
if (Directory.Exists(SrcPath))
{
string[] files = Directory.GetFiles(SrcPath);
for (int i = 0; i < files.Length; i++)
{
Console.WriteLine(files[i]);
string[] list = files[i].Split('\\');
if (!File.Exists(DisPath + list[list.Length - 1]))
{
File.Move(files[i], DisPath + list[list.Length - 1]);
}
}
}
}
protected override void OnStop()
{
}
}
Проверили ли вы войти событие? – Oded
нет, это моя первая услуга, и я ничего об этом не знаю. знаете ли вы какую-либо ссылку на учебные услуги? – Rasoul
http://msdn.microsoft.com/en-us/library/y817hyb6(v=vs.100).aspx –