netlistmgr

前端之家收集整理的这篇文章主要介绍了netlistmgr前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

#include <windows.h> #include <stdio.h> #include <Netlistmgr.h> void main() { HRESULT hr = 0; VARIANT_BOOL vb = 0; INetworkListManager* pNlm = NULL; hr = CoInitialize( NULL ); if( Failed(hr) ) { printf( "CoInitialize Failed./n" ); return; } hr = CoCreateInstance( CLSID_NetworkListManager,NULL,CLSCTX_ALL,IID_INetworkListManager,(void**) &pNlm ); if( Failed(hr) ) { printf( "CoCreateInstance Failed./n" ); CoUninitialize(); return; } hr = pNlm->get_IsConnected ( &vb ); if( SUCCEEDED(hr) ) { if( vb ) { printf("Network Connected!/n" ); } else { printf("Network Not Connected./n" ); } } else { printf( "get_IsConnected Failed./n" ); } pNlm->Release(); CoUninitialize(); return; }

原文链接:https://www.f2er.com/vb/261281.html

猜你在找的VB相关文章