Visual Basic - AYUDA

Life is soft - evento anual de software empresarial
 
Vista:

AYUDA

Publicado por CybertowerS (27 intervenciones) el 15/11/2001 11:40:53
Hola foro:
Necesito poder hacer estas 3 cosas:
a) Mostrar en pantalla la IP del Pc en que se esta ejecutando mi aplicación.
b) Saber si el Pc en que se está ejecutando mi aplicación está conectado o no a internet (ya sea por modem normal, rdsi, lan, adsl...)
c) Poder mostrar en un List las direcciones de correo de la libreta de direcciones del outlook o del cliente de correo predeterminado.
Muchas gracias a tod@s por la posible ayuda que me podais prestar. Agradezco cualquier ayuda y/o sugerencia. Llevo bastante tiempo intentándo sacar esto, es por ello por lo que me urge.
Gracias.
>>>CybertowerS<<<
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:AYUDA

Publicado por Javier Pérez (170 intervenciones) el 16/11/2001 05:41:26
a) El control Winsock (Microsoft Winsock Control) tiene dos propiedades que te proporcionan el nombre del equipo local y la dirección IP local:

Winsock1.LocalHostName
Winsock1.LocalIP

Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:AYUDA

Publicado por Javier Pérez (170 intervenciones) el 16/11/2001 05:42:58
b1) Incluye las siguientes declaraciones en un módulo:

Public Const NETWORK_ALIVE_LAN = &H1 'The computer has one or more active LAN cards.
Public Const NETWORK_ALIVE_WAN = &H2 'The computer has one or more active RAS connections.
Public Const NETWORK_ALIVE_AOL = &H4 'This flag is only valid in Windows 95 and Windows 98.
'The computer is connected to the America Online network.

Public Type QOCINFO
dwSize As Long 'Upon calling the IsDestinationReachable function, the caller supplies the size
'of the QOC structure in this member. On return from the function, this member
'contains the actual size of the structure that was filled in.
dwFlags As Long ' NETWORK_ALIVE_LAN, NETWORK_ALIVE_WAN, NETWORK_ALIVE_AOL flags
dwInSpeed As Long 'Speed of data coming in from the destination in bytes per second.
dwOutSpeed As Long 'Speed of data sent to the destination in bytes per second.
End Type
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:AYUDA

Publicado por Javier Pérez (170 intervenciones) el 16/11/2001 05:44:04
b2)
'lpszDestination Pointer to string specifying destination
'lpQOCInfo Pointer to Quality of Connection information
Public Declare Function IsDestinationReachable Lib "sensapi.dll" Alias "IsDestinationReachableA" (ByVal lpszDestination As String, lpQOCInfo As QOCINFO) As Long

'lpdwFlags Specifies the type of network connection
Public Declare Function IsNetworkAlive Lib "sensapi.dll" (lpdwFlags As Long) As Long

Luego puedes hacer algo así:

Dim qoc As QOCINFO
Dim result As Long

If IsNetworkAlive(NETWORK_ALIVE_WAN) Then
' La red es accesible
qoc.dwSize = 16
If IsDestinationReachable("www.microsoft.com", qoc) Then
' El sitio es accesible
End If
End If
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:AYUDA

Publicado por CybertowerS (27 intervenciones) el 16/11/2001 08:57:43
Muchas gracias. Este Lunes lo probaré sin falta.
Gracias de nuevo.
Salu2.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar