Click here to Skip to main content
16,012,508 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
how can we write code to create scheduler task to ping a system with in each hour . Once it gets connection it should perform the task . My task is to update in sql server once its get network connection otherwise keep on try pinging in each hour continuously.
Posted
Updated 21-Apr-13 20:33pm
v5
Comments
[no name] 16-Apr-13 20:30pm    
So what have you tried yourself? Hint: You are not going to do this in ASP.NET.
Sergey Alexandrovich Kryukov 16-Apr-13 21:26pm    
Good point. A Web application is fully driven by the HTTP request. Even if you can run scheduler by some HTTP request, you cannot known about any scheduled events until next HTTP request.
—SA
lalit.mca2006 16-Apr-13 22:59pm    
yes its asp.net web application . I am trying to write an console application and will run this console exe at each hour .
Am i right ? Http request handling will be tough for me .
[no name] 17-Apr-13 9:11am    
using of web service u can connect to ur web site and upload information to web site sql server,
using ur console applcation... and using httpwebrequest class u can see net is available or not i mean request for any web url and if response came as 200 than internet available than u call ur webservice from your web and save information in sql database

1 solution

create a win form or console application, which will run cmd commands in c#(search on code project regarding it with process class u can run cmd commands), after that u need to use window(os) task scheduler and schedule it when ever net connect run your win application.

or

u can write a thread in ur console application to run every hour and keep reference to startup folder in window(os)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900