从远程服务器执行ping

时间:2016-08-31 14:56:38

标签: vb.net

使用VS 2015和VB.net。

我有一个Web应用程序,我想从远程服务器执行ping。服务器正在运行Windows Server R2 2012。

服务器连接了一台路由器,定期进入睡眠状态,此时我们登录服务器并开始ping路由器以唤醒它。各种用户将访问Web应用程序,点击按钮即可启动ping。 Web应用程序托管在我们的Web服务器(而不是远程服务器)上,并且ping必须来自远程服务器,因为路由器的IP地址是远程服务器的本地IP地址,并且在其他任何地方都不可见。

从我的应用程序中我想在代码中执行此操作,但我不知道从哪里开始(一直在搜索)。

我不是要求代码我只是想知道我应该看什么。

1 个答案:

答案 0 :(得分:1)

using a scheduled task as @Nkosi pointed in his comment is not a bad idea, but the most professional and stable way is to write a windows Service that will handle this task. a service is different than a process, its always runs on the background and NT User is not have to be logged in. you can setup timers to schedule the pinging inside the service application. Creating a Windows Service Application