Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何在c中为接口类型“ppp”获取“真实”的NetworkInterfaceType(或NetworkInterfaceSubType)?_C#_.net_Networking - Fatal编程技术网

C# 如何在c中为接口类型“ppp”获取“真实”的NetworkInterfaceType(或NetworkInterfaceSubType)?

C# 如何在c中为接口类型“ppp”获取“真实”的NetworkInterfaceType(或NetworkInterfaceSubType)?,c#,.net,networking,C#,.net,Networking,我知道,标题很奇怪,但我解释我的问题: 在windows phone代码中,对于检测网络类型,我们可以使用 NetworkInterfaceInfo info = nrr.NetworkInterface; if (info != null) { switch (info.InterfaceType) { case NetworkInterfaceType.Ethernet: myInterface = NETWORK_TYPE_ETHER

我知道,标题很奇怪,但我解释我的问题:

在windows phone代码中,对于检测网络类型,我们可以使用

NetworkInterfaceInfo info = nrr.NetworkInterface;
if (info != null)
{
    switch (info.InterfaceType)
    {
        case NetworkInterfaceType.Ethernet:
            myInterface = NETWORK_TYPE_ETHERNET;
                break;
        case NetworkInterfaceType.MobileBroadbandCdma:
            myInterface = NETWORK_TYPE_CDMA;
            switch (info.InterfaceSubtype)
            {
                 case NetworkInterfaceSubType.Cellular_HSPA:
                     mySubInterface = NETWORK_TYPE_CDMA_HSPA;
                     break;
                 case NetworkInterfaceSubType.Cellular_EDGE:
                     mySubInterface = NETWORK_TYPE_CDMA_EDGE;
                     break;
                 case NetworkInterfaceSubType.Cellular_GPRS:
                     mySubInterface = NETWORK_TYPE_CDMA_GPRS;
                     break;
             }
             break;
     }
 }
该代码正常工作,对于示例,如果网络是CDMA类型,我可以访问子类型;我知道windowsPhone是GPRS、EDGE还是HSPA

在C4中,我在连接笔记本电脑中的拨号键时检测到:

if( (NetworkInterfaceType.Ppp == networkCard.NetworkInterfaceType)
   ||(NetworkInterfaceType.GenericModem == networkCard.NetworkInterfaceType)
   ||(NetworkInterfaceType.Slip == networkCard.NetworkInterfaceType)
  ){
   // It's the Dialup Key interface Type.
   }
但是,我没有关于最终子类型的信息。。。 我想知道我的钥匙是用GPRS、EDGE还是HSPA连接的

您知道吗,必须继续检索真实的网络信息类型GPRS、EDGE、HSPA。。。当连接3G密钥时


非常感谢。

你说的nrr是什么意思?你可以尝试使用移动宽带api=>你说的nrr是什么意思?你可以尝试使用移动宽带api=>