?
Solved

Scheduled Windows Form Application or Console Application with GUI

Posted on 2008-11-08
6
Medium Priority
?
1,398 Views
Last Modified: 2013-12-17
I need to create an application that runs daily (mon-fri) as a schedule.  

I could do this as a console application but the settings for the app need to be in a friendly GUI format and there are a number of other issues that would require a GUI i.e I need to produce reports showing exceptions and processed data, also previous runs and their results in tabular form that can be sorted by clicking the header column.

You also need to be able to run a process manually if the schedule failed.

I thought of having a console application for the process and then a GUI application for the other bits.  Is there a more efficient way where all code resides in one project.

Thanks

Lee
0
Comment
Question by:zensolutions
  • 3
  • 2
6 Comments
 
LVL 8

Expert Comment

by:wguerram
ID: 22913432
You could create Projects libraries, that will hold the GUI part.
0
 

Author Comment

by:zensolutions
ID: 22913587
Could you elaborate on how this would work and how to actually code it please?  I am new to C# .NET.
0
 
LVL 7

Accepted Solution

by:
keustermans earned 1000 total points
ID: 22920114
What was mwant her is that you can create multiple projects in one solution one project for the GUI one project for the Console Application.  Diong it this way will also give you the option to cahnge the GUI to asp.net with out haveing to recode the console app.

Have you thought of using windows services for scheduled tasks?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:zensolutions
ID: 22920270
i read somewhere that for a task that needs to be run at a specific time daily that it is better to run as a scheduled task and not a windows service.  I felt that the windows service would be a good way of implementing the solution but then when I read that I started looking at the scheduled task method.  Do you have any ideas of how to do this in a windows service?
0
 
LVL 7

Expert Comment

by:keustermans
ID: 22921597
It is faily simple to do this in a windows service.

You create a windows service that contains a timer that runs code every so often. then you have a config file that you use to set the time when the specific logic is suposed to be run i.e the schedule.

In the timer elapsed event you compare the current time to the time in your config file and run the logic if the time matches the scheduled time criteria. On completion you can set a flag in the registry to indicate that the scheduled task ran correctly.  

You logic should then contain code that checks the registry for the task completed flag as well.  If the flag was not set due to some issue then you can run it again.

Your logic flow should be as follows

Check if task was completed by querying the registry.
If not compare the times
if the current time is equal or bigger to the scheduled time then run the task
If the task completes without errors then set the regstry flag

it would wise to set a window in which you want the task to run.  Let say you want to run a task at 5PM then you should give it a window to run in if it does not complete the first time. Lets say the window is 2 hours.  Then the task will attempt to execute between 5PM and 7PM until it ran succesfully.

I hop this makes sense to you.
0
 

Author Closing Comment

by:zensolutions
ID: 31514701
I read a bit more about the windows service and after looking through a number of fors and against decided to go with the one solution with multiple projects.  Thanks for your time.  I may be back when I get to the next stages of deveolpment with more questions.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question