以下代码在完成之前退出,没有例外:
private void Form1_Load(object sender, EventArgs e)
{
MbnConnectionManager connectionManager = new MbnConnectionManager();
IMbnConnectionManager connectionManagerInterface = (IMbnConnectionManager)connectionManager;
IMbnConnection[] connections = (IMbnConnection[])connectionManagerInterface.GetConnections();
(IMbnConnectionProfileManager)connectionProfile;
MbnApi.MbnInterfaceManager interfaceManager = new MbnInterfaceManager();
MbnApi.IMbnInterfaceManager interfaceManagerInterface = (IMbnInterfaceManager)interfaceManager;
IMbnInterface[] interfaces = interfaceManagerInterface.GetInterfaces() as IMbnInterface[];
foreach (IMbnInterface mbnInterface in interfaces)
{
MBN_PROVIDER homeProvider = mbnInterface.GetHomeProvider(out homeProvider);
}
}
这条线似乎导致了崩溃 -
MBN_PROVIDER homeProvider = mbnInterface.GetHomeProvider(out homeProvider);
为什么会出现这种情况,是否有任何方法可以了解移动宽带API内部究竟发生了什么?
答案 0 :(得分:2)
您是否在系统中注册了宽带设备?
netsh mbn show interfaces