서버 모니터링에 필요해서... 어렵지 않아요~~^^
msdn. http://msdn.microsoft.com/en-us/library/windows/desktop/aa370803(v=vs.85).aspx
NETWORKLIST.NetworkListManager _nlManager = new NETWORKLIST.NetworkListManager(); foreach(NETWORKLIST.INetwork _network
in _nlManager.GetNetworks(NETWORKLIST.NLM_ENUM_NETWORK.NLM_ENUM_NETWORK_CONNECTED)) { Console.WriteLine(_network.GetName()); Console.WriteLine(_network.GetCategory()); foreach(NETWORKLIST.INetworkConnection c in _network.GetNetworkConnections()) { var k = from _nis in NetworkInterface.GetAllNetworkInterfaces()
where _nis.Id == c.GetAdapterId().ToString("B").ToUpper() select _nis; if (k != null & k.Count() > 0) { NetworkInterface _ni = k.FirstOrDefault(); Console.WriteLine(_ni.Id); Console.WriteLine(_ni.Name); } } }
네트워크
NLM_NETWORK_CATEGORY_PUBLIC
{465ac774-d5f4-4a3f-9351-51440256a6bb}
{465AC774-D5F4-4A3F-9351-51440256A6BB}
로컬 영역 연결 3
댓글 없음:
댓글 쓰기