如何创建调度程序任务来ping网络中的计算机并同步ASP.NET中所有计算机中的sql server记录(C#) [英] how to create scheduler task to ping a computer in network and sync the sql server records in all computers in ASP.NET (C#)

查看:72
本文介绍了如何创建调度程序任务来ping网络中的计算机并同步ASP.NET中所有计算机中的sql server记录(C#)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们如何编写代码来创建调度程序任务,以便在每小时内ping一个系统。一旦它获得连接,它应该执行任务。我的任务是在sql服务器获得网络连接后更新,否则继续每小时连续尝试ping。

解决方案

创建一个win表单或控制台应用程序,在c#中运行cmd命令(使用进程类搜索关于它的代码项目,你可以运行cmd命令),之后你需要使用window(os)任务调度程序并在net connect运行你的win应用程序时安排它。







u可以在你的控制台应用程序中写一个线程来运行每小时并在窗口中保持对启动文件夹的引用( OS)

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.

解决方案

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)


这篇关于如何创建调度程序任务来ping网络中的计算机并同步ASP.NET中所有计算机中的sql server记录(C#)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆