Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Internet
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Grupo de Teaming del ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 21-03-2008
maro maro is offline
Miembro
 
Registrado: sep 2003
Ubicación: Sevilla
Posts: 104
Poder: 21
maro Va por buen camino
usar upnp con Delphi para configurar nat en un router?

Hola,

He leído en algunas páginas, por Internet, que utilizando upnp es posible añadir un registro a la tabla de nat del router, de tal forma que un programa que contenga un servidor tcp pueda "escuchar" de forma transparente, sin que el usuario tenga que configurar el router o firewall.

Incluso he encontrado este código:
Código Delphi [-]
Procedure AddUPnPEntry( Port : Integer;  const Name : ShortString);
Var
  Nat   : Variant;
  Ports : Variant;
Begin
  if NOT (LAN_IP = '127.0.0.1') then
  begin
    try
      Nat := CreateOleObject('HNetCfg.NATUPnP');
      Ports := Nat.StaticPortMappingCollection;
                        showMessage(inttostr(Ports.count));
      Ports.Add(port, 'TCP', port, LAN_IP, True, name);
    except
      ShowMessage(
        'An Error occured with adding UPnP Ports. The ' + name +
        ' port was not added to the router.  Please check to see if your ' +
        'router supports UPnP and has it enabled or disable UPnP.'
      );
    end;
    {[2006/03/04] CR - I'd looked into other ways to handle errors, but,
     unfortunately the try-except Alex used here originally is the ONLY way
     to trap errors.  OLE/.COM bites, if you have to rely on exceptions all the
     time! :P~~ }
  end;
End; { Proc AddUPnPEntry}

pero no consigo que funcione.

¿Alguén sabe algo sobre este tema?

Muchas gracias.
Un Saludo.
__________________
Maro. OutSourcing de programación con Delphi.
Responder Con Cita
 



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
exportar .h para usar en Delphi ? Guillermo80 C++ Builder 0 19-01-2008 20:28:57
Programa para medir cantidad de saltos por router en web.. JuanErasmo Internet 9 30-11-2006 00:21:45
Como puedo configurar un host y un Router? danytorres Redes 0 19-01-2006 15:13:17
10 razones para dejar de usar Delphi.. Delfino Humor 5 18-10-2005 01:41:58
Configurar Router ADSL Telefónica DarkByte Linux 13 22-02-2004 09:42:44


La franja horaria es GMT +2. Ahora son las 22:15:41.


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