C# Check Remote Server

后端 未结 5 1858
没有蜡笔的小新
没有蜡笔的小新 2020-12-15 06:18

Can anyone advise what the best way to check (using .NET 3.5) if a remote server is available?

I was thinking of using the following code but would like to know if

5条回答
  •  不知归路
    2020-12-15 06:57

    I'm guessing you want to check to see if a website is available. You could just use a System.Net.WebRequest and check the result.

    Update: Based on your comment, if you've got a few servers (and services) to monitor, then maybe it'd be a better idea to use a package such as Nagios, HostMonitor or IPSentry instead of rolling your own.

提交回复
热议问题