c# - hresult from IMbnInterfaceManager::GetInterfaces when no MBN device exists -
i have following code working in windows 7:
mbninterfacemanager mbninfmgr = new mbninterfacemanager(); imbninterfacemanager mbninfmgrinterface = mbninfmgr imbninterfacemanager; if (mbninfmgrinterface != null) { imbninterface[] mobileinterfaces = mbninfmgrinterface.getinterfaces() imbninterface[]; }
no problems when mbn device exists when mbn device doesn't exist following exception in call getinterfaces():
{system.runtime.interopservices.comexception (0x80070490): element not found. (exception hresult: 0x80070490) @ mbnapi.imbninterfacemanager.getinterfaces() @ foo.program.configureconnection() in foo}
question there should done check mbn interface before calling getinterfaces? can catch exception can't find documentation says exception same having no interfaces.
the closest thing have found on statckoverflow struggling mobile broadband api windows 7 , windows 8 c#, not sure install implies maybe windows 7 behaves differently windows 8.1.
i got same element not found
exception trying use getsignalstrength() , mbninterfacemanager instead found can obtain lot of useful info using wmi. please see answer here using select * win32_perfrawdata_tcpip_networkinterface
:
struggling mobile broadband api windows 7 , windows 8 c#, not sure install
update:
please note found cannot network info in windows 8.1 in same way in windows 7. see how can install application requires wmi capabilities on windows 8.1 determine available bandwidth? , https://code.msdn.microsoft.com/windowsapps/network-information-sample-63aaa201
Comments
Post a Comment