I have a Windows Service consisting of a timer with 4000 Interval, in tick method of timer a save method run and save a bitmap file in specific path, it is like the following:
protected override void OnStart(string[] args) {
CaptureTimer.Start();
}
private void CaptureTimer_Tick(object sender, EventArgs e) {
DateTime dt = DateTime.Now;
Bitmap capture = Capture.GetImage();
capture.Save(@"D:\Doc\Temp\GeoServiceFiles\" + Environment.MachineName +
dt.Ticks.ToString() + ".bmp");
}
but there is not any saved file, I test the exact code in Win Application and that worked correctly replaced OnStart method with button1_Click. also for test my service add an eventlog: eventLog1.WriteEntry("test service");
and log saved correctly but yet there isn't any saved file, So is there any special way to saved files with Windows Services?