Run the save functionality in a separate thread that you start in the OnStart method of your service. Something like this:
protected override void OnStart(string args[])
{
// your other initialization code goes here
// savePhotos is of type System.Threading.Thread
savePhotosThread = new Thread(new ThreadStart(SavePhotos));
savePhotosThread.IsBackground = true;
savePhotosThread.Name = "Save Photos Thread";
savePhotosThread.Start();
}
You'll place the functionality for saving the files in the `SavePhotos` method, maybe something like this:
private void SavePhotos()
{
// logic to save photos
}
I've used code similar to the above to do logging (I log stats for the service every 5 minutes or so) for an always-on service I wrote a few years back. Don't forget to add System.Threading to your service and the using directive.