2013-06-24 1 views
0

Windows 7 모바일 광대역 API에서 서비스 제공 업체 이름을 얻는 방법을 찾을 수 없습니다. provider.providerName은 항상 null 문자열을 반환하지만 공급자 ID는 영국에서 EE에 대해 올바른 값 (23430)입니다.모바일 광대역 - 서비스 제공 업체 이름을 얻는 방법

다음은이 정보를 얻는 데 사용되는 스 니펫입니다. Mbn 인터페이스의 다른 모든 측면은 프로파일 등을 포함하여 에서 작동하지만 이름을 얻는 방법을 찾을 수 없습니다!

내가 누락 된 항목이 있습니까? , 아무도 내 마지막 문제에 제발 좀 도와 줄래?

참고 : Windows VAN에는 서비스 제공 업체가 표시됩니다.

내 많은 감사

사라

/// 
/// Check the reported state of this interface 

    switch (readyState) 
    { 
     case MBN_READY_STATE.MBN_READY_STATE_INITIALIZED: 

     /// interface is initialised and has active SIM 
     /// so lets get service providor information 
     /// 
     MBN_PROVIDER provider = mobileInterface.GetHomeProvider(); 

     mi.Provider = provider.providerName;  // Always "" 
     mi.ProviderID = provider.providerID;  // but this is correct 
     mi.ProviderState = provider.providerState;  // as is all this 
     mi.Signaldbm = mbnGetSignal(mi.InterfaceID); 
     mi.Signalbar = mbnConvertSignal(mi.Signaldbm); 
     mi.Message = "Ready"; 
     break; 

시스템 설정

윈도우 7 레노버 노트북, F3507g 내장 모뎀

답변

0

, 프로그램 내 솔루션이었다 연결 구성을 위해 여기에 제공된 답변 : C# Read Windows Mobile Broadband connection properties

는이 인터페이스를 통해 반복하고 GetConnectionProfiles()를 호출 매개 변수로 인터페이스를 통과 한 후 가진이 XMLDocument를로드하여 ProfileName이 (netsh를 MBN 쇼 프로파일)을 찾기 위해 저를 도운 IMbnConnectionProfile GetProfileXMLData ProfileName이는이 XMLDocument에

[ "MbnProfile"] [ "Name"] InnerText

많은 작업처럼 보이지만 하나의 인터페이스와 하나의 프로필에 대해서만 신경 써야한다면 각 배열의 첫 번째 요소를 사용할 수 있습니다. 내 코드를 붙이 겠지만 VB이다.

Dim mcpm As MbnConnectionProfileManager = New MbnConnectionProfileManager() 
Dim imcpm As IMbnConnectionProfileManager = DirectCast(mcpm, IMbnConnectionProfileManager) 
Dim connectionProfiles() As IMbnConnectionProfile 


Dim mim As MbnInterfaceManager = New MbnInterfaceManager() 
Dim imim As IMbnInterfaceManager = DirectCast(mim, IMbnInterfaceManager) 
Dim interfaceArray() As IMbnInterface = imim.GetInterfaces() 

For Each i As IMbnInterface In interfaceArray 
    connectionProfiles = imcpm.GetConnectionProfiles(i) 
    For Each c As IMbnConnectionProfile In connectionProfiles 
     Dim doc As System.Xml.XmlDocument = New System.Xml.XmlDocument() 
     doc.LoadXml(c.GetProfileXmlData()) 

     cmbMBNProfileName.Items.Add(doc("MBNProfile")("Name").InnerText) 
    Next 
Next 
관련 문제