如题

解决方案 »

  1.   

    给你个示例:
    // Quit a dial up connection - rasapi32.lib und #include "ras.h" needed
    bool DisconnectRas()
    {
       bool bOk = false;
       RASCONN ras[20];
       DWORD dSize,dNumber,dCount;
       ras[0].dwSize = sizeof(RASCONN);
       dSize = sizeof( ras );
       // Get active RAS - Connection
       if( RasEnumConnections( ras, &dSize, &dNumber ) == 0 )
       {
          bOk = true;
          for( dCount = 0; dCount < dnumber; dCount++ )
          {
             // Hang up that connection
             if( RasHangUp(ras[dCount].hrasconn) != 0 )
             {
                bOk = false;
                break;
             }
          }
       }
       return bOk;
    }
      

  2.   

    楼主到网络编程版块里看看FAQ,里面有一个问题很相似