Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Otros entornos y lenguajes > C++ Builder
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 04-04-2017
Snaked Snaked is offline
Baneado
NULL
 
Registrado: sep 2016
Posts: 102
Poder: 0
Snaked Va por buen camino
Si alguien tiene tiempo y puede convertir estas funciones a C++ Builder

Tengo estas 2 funciones que me gustaria probar pero estan en Delphi y yo estoy con C++ Builder

solo si alguien tiene algo de tiempo y me las podria convertir para probarlas a ver si son mejores que las que estoy usando

un saludo y gracias por el interes

Código PHP:
    type
      TWifiData 
record
        InterfaceInfo
String;
        
ProfileString;
        
SSIDString;
        
Signalinteger;
        
AuthString;
        
ConectedBOOL;
      
end;
     
     
    function 
WifiScan(var List: array of TWifiData): integer;
    const
      
AuthStr: array [1..9]of String = ('Open','Shared Key','WPA','WPA-PSK','WPA NONE','RSNA','RSNA-PSK','IHV Start','IHV End');
    var
      
hClientTHandle;
      
dwVersionDWORD;
      
pInterfaceInfoListPWLAN_INTERFACE_INFO_LIST;
      
pInterfaceGuidPGUID;
      
pNetworkListPWLAN_AVAILABLE_NETWORK_LIST;
      
ijinteger;
    
begin
      Result
:= 0;
      if 
ERROR_SUCCESS WlanOpenHandle(1nil, @dwVersion, @hClientthen
      begin
        
if ERROR_SUCCESS WlanEnumInterfaces(hClientnil, @pInterfaceInfoListthen
        begin
          
for := 0 to pInterfaceInfoList^.dwNumberOfItems do
          
begin
            pInterfaceGuid
:= @pInterfaceInfoList^.InterfaceInfo[pInterfaceInfoList^.dwIndex].InterfaceGuid;
            if 
ERROR_SUCCESS WlanGetAvailableNetworkList(hClientpInterfaceGuid1nilpNetworkListthen
            begin
              
for := 0 to pNetworkList^.dwNumberOfItems do
              
begin
                Result
:= pNetworkList^.dwNumberOfItems;
                
with List[j] do
                
begin
                  InterfaceInfo
:= pInterfaceInfoList^.InterfaceInfo[0].strInterfaceDescription;
                  
Profile:= WideCharToString(pNetworkList^.Network[j].strProfileName);
                  
SSID:= PChar(@pNetworkList^.Network[j].dot11Ssid.ucSSID);
                  
Signal:= pNetworkList^.Network[j].wlanSignalQuality;
                  
Auth:= AuthStr[pNetworkList^.Network[j].dot11DefaultAuthAlgorithm];
                  
Conected:= (pNetworkList^.Network[j].dwFlags and WLAN_AVAILABLE_NETWORK_CONNECTED) <> 0;
                
end;
              
end;
              
WlanFreeMemory(pNetworkList);
            
end;
          
end;
          
WlanFreeMemory(pInterfaceInfoList);
        
end;
        
WlanCloseHandle(hClientnil);
      
end;
    
end;
     
    function 
WifiConect(SSIDWideString): BOOL;
    var
      
hClientTHandle;
      
dwVersionDWORD;
      
pInterfaceInfoListPWLAN_INTERFACE_INFO_LIST;
      
pInterfaceGuidPGUID;
      
iinteger;
      
pWLCPPWLAN_CONNECTION_PARAMETERS;
    
begin
      Result
:= false;
      if 
ERROR_SUCCESS WlanOpenHandle(1nil, @dwVersion, @hClientthen
      begin
        
if ERROR_SUCCESS WlanEnumInterfaces(hClientnil, @pInterfaceInfoListthen
        begin
          
for i:= 0 to pInterfaceInfoList^.dwNumberOfItems do
          
begin
            pInterfaceGuid
:= @pInterfaceInfoList^.InterfaceInfo[pInterfaceInfoList^.dwIndex].InterfaceGuid;
            
pWLCP:= WlanAllocateMemory(sizeof(TWLAN_CONNECTION_PARAMETERS));
            
pWLCP.strProfile:= PWCHAR(SSID);
            
pWLCP.wlanConnectionMode:= 0;
            
pWLCP.pDot11Ssid:= nil//pDot11_DDSI;
            
pWLCP.pDesiredBssidList:= nil;
            
pWLCP.dot11BssType:= 1;
            
pWLCP.dwFlags:= 0;//$F;
            
Result:= (ERROR_SUCCESS WlanConnect(hClientpInterfaceGuidpWLCPnil));
            
WlanFreeMemory(pWLCP);
          
end;
          
WlanFreeMemory(pInterfaceInfoList);
        
end;
        
WlanCloseHandle(hClientnil);
      
end;
    
end;
     
    function 
WifiDisConectBOOL;
    var
      
hClientTHandle;
      
dwVersionDWORD;
      
pInterfaceInfoListPWLAN_INTERFACE_INFO_LIST;
      
pInterfaceGuidPGUID;
      
iinteger;
    
begin
      Result
:= false;
      if 
ERROR_SUCCESS WlanOpenHandle(1nil, @dwVersion, @hClientthen
      begin
        
if ERROR_SUCCESS WlanEnumInterfaces(hClientnil, @pInterfaceInfoListthen
        begin
          
for i:= 0 to pInterfaceInfoList^.dwNumberOfItems do
          
begin
            pInterfaceGuid
:= @pInterfaceInfoList^.InterfaceInfo[pInterfaceInfoList^.dwIndex].InterfaceGuid;
            
WlanDisconnect(hClientpInterfaceGuidnil);
          
end;
          
WlanFreeMemory(pInterfaceInfoList);
        
end;
        
WlanCloseHandle(hClientnil);
      
end;
    
end
Responder Con Cita
  #2  
Antiguo 06-04-2017
Avatar de escafandra
[escafandra] escafandra is offline
Miembro Premium
 
Registrado: nov 2007
Posts: 2.195
Poder: 20
escafandra Tiene un aura espectacularescafandra Tiene un aura espectacular
Aunque el código publicado en los foros es libre, es una excelente y elegante costumbre publicar la fuente del lugar donde se copió y una forma de agradecer al autor su contribución: Jugando con las conexiones Wifi

Saludos.

Última edición por escafandra fecha: 06-04-2017 a las 21:57:14.
Responder Con Cita
  #3  
Antiguo 07-04-2017
Avatar de Casimiro Notevi
Casimiro Notevi Casimiro Notevi is online now
Moderador
 
Registrado: sep 2004
Ubicación: En algún lugar.
Posts: 32.022
Poder: 10
Casimiro Notevi Tiene un aura espectacularCasimiro Notevi Tiene un aura espectacular
Cita:
Empezado por escafandra Ver Mensaje
Aunque el código publicado en los foros es libre, es una excelente y elegante costumbre publicar la fuente del lugar donde se copió y una forma de agradecer al autor su contribución: Jugando con las conexiones Wifi

Saludos.
Responder Con Cita
Respuesta


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
alguien puede convertir esta funcion a C++ Builder ? Snaked C++ Builder 5 27-10-2016 00:08:01
Mudar Estas funciones de vb a Delphi ColdFusion Varios 9 22-01-2009 02:45:58
MySQL.Pas alguien lo tiene DarkDrakon Conexión con bases de datos 1 07-12-2007 17:57:15
Alguien tiene FastReport 1.0 Gaby123 Impresión 0 06-09-2006 17:45:31
alguien tiene el CristalReport??? Bitbanner Impresión 1 11-02-2005 18:11:59


La franja horaria es GMT +2. Ahora son las 10:49:42.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi