[System.Net을 이용하여 알아보기]

bool networkUp
   
= System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable();

 

또는

 

NetworkInterface[] networkCards
   
= System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces();

 

[IP를 이용하여 알아보기]

IPEndPoint ipep =  new IPEndPoint(Ipaddress.Parse("IP TO CHECK"), YOUR_PORT_INTEGER);
Socket server = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
server
.Connect(ipep);

 

[Ping 테스트로 알아보기]

Ping netMon = new Ping();
PingResponse response = netMon.PingHost(hostname, 4);
if (response != null)
{
   
ProcessResponse(response);
}

 

Posted by 홍상길 홍상길

블로그 이미지
홍상길

공지사항

Yesterday14
Today1
Total293,169

달력

 « |  » 2019.8
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31

최근에 달린 댓글

글 보관함