Foros del Web » Programación para mayores de 30 ;) » Programación General »

contador de internet

Estas en el tema de contador de internet en el foro de Programación General en Foros del Web. Hola gente, como va? Miren, tengo la siguiente duda... Sucede q huzo en mi casa conexion por telefono para internet, y me hice un programita ...
  #1 (permalink)  
Antiguo 11/06/2004, 16:55
Avatar de alealvaro  
Fecha de Ingreso: junio-2004
Ubicación: BA - Argentina
Mensajes: 210
Antigüedad: 19 años, 10 meses
Puntos: 12
contador de internet

Hola gente, como va?
Miren, tengo la siguiente duda...
Sucede q huzo en mi casa conexion por telefono para internet, y me hice un programita para ir contando el tiempo q llevo usado para "controlarme" jejeje . La cuestion es q lo hice para q yo tenga q activarlo y desactivarlo cuando me conecto y me desconecto, y quisiera saber... es muy jodido hacer que detecte solito cuando se inicia una sesion de internet y cuando esta se cierra???.. y si alguien me puede facilitar el codigo para lograr esto me ayudaria mucho!!
Muchas gracias!!
Alejandro
  #2 (permalink)  
Antiguo 11/06/2004, 17:02
Avatar de Eternal Idol  
Fecha de Ingreso: mayo-2004
Ubicación: Lucentum
Mensajes: 6.192
Antigüedad: 20 años
Puntos: 74
En que lenguaje? En que Sistema Operativo?
__________________
¡Peron cumple, Evita dignifica! VIVA PERON CARAJO
  #3 (permalink)  
Antiguo 12/06/2004, 10:56
Avatar de alealvaro  
Fecha de Ingreso: junio-2004
Ubicación: BA - Argentina
Mensajes: 210
Antigüedad: 19 años, 10 meses
Puntos: 12
uhhhh q despistado jejeje me olvide de decir esto jeje
Lo hice en visual basic 6... y trabajando bajo win98...
Gracias!!!
  #4 (permalink)  
Antiguo 12/06/2004, 11:55
Avatar de Eternal Idol  
Fecha de Ingreso: mayo-2004
Ubicación: Lucentum
Mensajes: 6.192
Antigüedad: 20 años
Puntos: 74
Fijate si te sirve este código (no es mio):

Private Const INTERNET_CONNECTION_CONFIGURED = &H40
Private Const INTERNET_CONNECTION_LAN = &H2
Private Const INTERNET_CONNECTION_MODEM = &H1
Private Const INTERNET_CONNECTION_OFFLINE = &H20
Private Const INTERNET_CONNECTION_PROXY = &H4
Private Const INTERNET_RAS_INSTALLED = &H10
Private Declare Function InternetGetConnectedState Lib "wininet.dll" (ByRef lpdwFlags As Long, ByVal dwReserved As Long) As Long
Private Sub Form_Load()
'KPD-Team 2001
'URL: http://www.allapi.net/
'E-Mail: [email protected]
Dim Ret As Long
Me.AutoRedraw = True
'retrieve the connection status
InternetGetConnectedState Ret, 0&
'show the result
If (Ret And INTERNET_CONNECTION_CONFIGURED) = INTERNET_CONNECTION_CONFIGURED Then Me.Print "Local system has a valid connection to the Internet, but it may or may not be currently connected."
If (Ret And INTERNET_CONNECTION_LAN) = INTERNET_CONNECTION_LAN Then Me.Print "Local system uses a local area network to connect to the Internet."
If (Ret And INTERNET_CONNECTION_MODEM) = INTERNET_CONNECTION_MODEM Then Me.Print "Local system uses a modem to connect to the Internet."
If (Ret And INTERNET_CONNECTION_OFFLINE) = INTERNET_CONNECTION_OFFLINE Then Me.Print "Local system is in offline mode."
If (Ret And INTERNET_CONNECTION_PROXY) = INTERNET_CONNECTION_PROXY Then Me.Print "Local system uses a proxy server to connect to the Internet."
If (Ret And INTERNET_RAS_INSTALLED) = INTERNET_RAS_INSTALLED Then Me.Print "Local system has RAS installed."
End Sub

'Example by Vijay Phulwadhawa ([email protected])
Private Declare Function InternetGetConnectedStateEx Lib "wininet.dll" (ByRef lpdwFlags As Long, ByVal lpszConnectionName As String, ByVal dwNameLen As Integer, ByVal dwReserved As Long) As Long
Dim sConnType As String * 255
Private Sub Form_Load()
Dim Ret As Long
Ret = InternetGetConnectedStateEx(Ret, sConnType, 254, 0)
If Ret = 1 Then
MsgBox "You are connected to Internet via a " & sConnType, vbInformation
Else
MsgBox "You are not connected to internet", vbInformation
End If
End Sub
__________________
¡Peron cumple, Evita dignifica! VIVA PERON CARAJO
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 11:07.