I have an application that requires the management of a mobile broadband API.
I am fighting for the correct api installation on my devices.
I follow the instructions in this document:
http://www.google.be/url?sa=t&rct=j&q=&esrc=s&frm=1&source=web&cd=1&cad=rja&ved=0CC0QFjAA&url=http%3A%2F%2Fdownload.microsoft.com%2Fdownload%2F7%2FE% 2F7% 2F7E7662CF-CBEA-470B-A97E-CE7CE0D98DC2% 2FMB_ManagedCode.docx & ei = kyvmUs7jE4e60QWbooHYDg & usg = AFQjCNG6yaGfy2fg2yaGfy2fg7ya2fg7ya2fg7ya2fg2ygfj2fg7ygfj2fg7ygfj2fg7ygfj2fg7ygf2
and try to combine the steps with this stackoverflow explanation
C # Read Broadband Properties for Windows Mobile
I was able to put the link from visual studio into mbnapi.tlb in V7.0 / lib. and now I automatically have interop.mbnapi.tlb in my obj / debug folder.
When trying to "check that the SIM card is inserted and working / activated." => my code crashes in the next line
IMbnInterface[] mobileInterfaces = mbnInfMgrInterface.GetInterfaces() as IMbnInterface[];
When I run it in windows 8, mbnInfMgrInterface == null
I already tried to install the same SDK on Windows 8, as indicated in the requirements of the document, but the SDK is only for Windows 7 ...
I tried registering mbnapi in Windows 8 by doing
Regtlibv12 Mbnapi.tlb
things are not going my way...
What do I need to do to make this work?
Does anyone have any experience with this?
EDIT. on Windows 7 (my development machine), I get the message "The device is not ready", I think itβs normal, because I donβt have mobile broadband, on Windows 8 I do, but there the mobile interface manager is null => mbnInfMgrInterface == null.
Thank you,
Not sure what you are after, but after fighting IMbnInterface and GetSignalStrength () (see https://msdn.microsoft.com/en-us/library/windows/desktop/dd323166(v=vs.85).aspx ) and unsuccessfully, I found that you can get a lot of information using WMI:
int maxBandwidth = 0; string query = "SELECT * FROM Win32_PerfRawData_Tcpip_NetworkInterface"; ManagementObjectSearcher moSearch = new ManagementObjectSearcher(query); ManagementObjectCollection moCollection = moSearch.Get(); foreach (ManagementObject mo in moCollection) { if (Convert.ToInt32(mo["CurrentBandwidth"]) > maxBandwidth) { // Instead of CurrentBandwidth you may want to use BytesReceivedPerSec maxBandwidth = Convert.ToInt32(mo["CurrentBandwidth"]); } }
See the answer here: Determining the speed of connection to the network connection and here is a list of properties that you can get: https://msdn.microsoft.com/en-us/library/aa394293(VS.85).aspx
UPDATE:
Please note that I can create and debug the above code (as part of a larger WPF application) from Visual Studio 2015 on Windows 7 or Windows 8.1, and I can deploy the same application on Windows 7, where it works successfully, For some the reason when I deploy this application on Windows 8.1 I get an Invalid query message.
Invalid query
UPDATE 2:
Please note that I found that you cannot get network information in Windows 8.1 in the same way as in Windows 7, because the System.Management namespace is not available in Windows 8.1. See https://code.msdn.microsoft.com/windowsapps/network-information-sample-63aaa201
System.Management
string connectionProfileInfo = string.Empty; ConnectionProfile InternetConnectionProfile = NetworkInformation.GetInternetConnectionProfile(); if (InternetConnectionProfile == null) { rootPage.NotifyUser("Not connected to Internet\n", NotifyType.StatusMessage); } else { connectionProfileInfo = GetConnectionProfile(InternetConnectionProfile); OutputText.Text = connectionProfileInfo; rootPage.NotifyUser("Success", NotifyType.StatusMessage); } // Which calls this function, that allows you to determine how strong the signal is and the associated bandwidth string GetConnectionProfile(ConnectionProfile connectionProfile) { // ... if (connectionProfile.GetSignalBars().HasValue) { connectionProfileInfo += "====================\n"; connectionProfileInfo += "Signal Bars: " + connectionProfile.GetSignalBars() + "\n"; } // ... }
Source: https://habr.com/ru/post/1241729/More articles:Understanding json_agg performance in Postgres 9.5 - performanceMultiple node properties for identifying node Unique - neo4jCan TypeConverter be used for constructor argument - c #hresult from IMbnInterfaceManager :: GetInterfaces when there is no MBN device - c #ASP.NET WebApi: (405) Method not allowed - asp.netHow to determine the bandwidth in Windows 7, 8.1 and 10? - c #Android dataBinding - custom application namespace is ignored @BindingAdapter - androidHow to remove AspxAutoDetectCookieSupport = 1 - asp.netApply template in file stream - javaFacebook profile image not showing with - imageAll Articles