ping ipaddress继续使用c#? [英] ping ipaddress continous using c# ?

查看:87
本文介绍了ping ipaddress继续使用c#?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

我想知道如何使用c#代码ping到ip地址

如:

ping 8.8.8.8 - t(连续)

hello
please i want to know how can i ping to ip address using c# code
like :
ping 8.8.8.8 -t ( continuous )

推荐答案

我认为没有任何理由,这听起来像是不必要的事情。



还要记住网络或服务器可能配置为禁用ping。



如果你真的想要,你可以使用无限 ,而循环在Windows服务或计划任务中。另请参见 http://msdn.microsoft.com/en-us/library /yf697k33(v=vs.110).aspx [ ^ ]



我不知道它会如何影响你的网络。
I don't see any reason to, and it sounds like a needless thing to do.

Also bear in mind that the network or server may be configured to disable ping anyway.

If you really want to, you could use an infinite for or while loop in a Windows Service or a Scheduled Task. See also http://msdn.microsoft.com/en-us/library/yf697k33(v=vs.110).aspx[^]

I have no idea how it would affect your network though.


您可以使用 ping 命令= vs.110).aspx> Process.Start方法(字符串) [ ^ ]方法。

为了定期执行它,你可以使用一个计时器(更好的方法是,如建议的那样,在任务计划程序中添加一个条目。
You may execute the ping command using the Process.Start Method (String)[^] method.
In order to periodically executing it, you might use a timer (a better way would be, as suggested, adding an entry in the Task Scheduler).


这篇关于ping ipaddress继续使用c#?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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