1 Attribute VB_Name
= "Global"
3 ' Este archivo es parte del programa "reseter", el cúal es pertenece a SVCommunity.org y a Todosv.com
4 ' Mantenedores principales:
7 ' Para soporte, dudas, consultas, inquitudes y demás:
8 ' http://www.svcommunity.org/forum/index.php?topic=25095.0
9 ' http://www.todosv.com/index.php?showtopic=331
10 Private TiempoMax
As Double
24 Direccion
As String 'Dirección a navegar
25 usuario
As String 'Usuario del router
26 clave
As String 'Clave del usuario del router
27 base
As String 'Dirección de la puerta de enlace
28 puerto
As Long 'Puerto de acceso
31 accionTipo
As e_AccionEX
34 codigo
As String 'Lista de codigos a ejecutarse
35 tipoAcceso
As e_Acceso
'Tipo de acceso [Telnet | Web]
36 renovar
As Boolean 'Ejecutar renovación de IP
37 asumirDes
As Boolean 'Asumir desconexion o probar?
39 Public m_Datos
As t_Datos
40 Public flag_Navegar
As Boolean
42 Public TelnetComandos() As String
43 Public nComando
As Integer
44 Public NetError
As Boolean
45 Private Intentos_Realizados
As Byte
46 Public pSocket
As AuroNet
47 Public ppSocket
As AuroNet
48 Public Tiempo
As cTimer
'Uso general
49 Public TiempoEx
As cTimer
'Uso secundario
50 Public TiempoEx2
As New cTimer
'Uso terciario
52 Public dXMR_ok
As Boolean
57 '------------------------
59 On Error GoTo main_Err
61 100 Set Tiempo
= New cTimer
62 101 Set TiempoEx
= New cTimer
63 'Empezamos a medir el tiempo que tarda en iniciar el programa
65 '------------------------
66 'Iniciamos los Sockets
67 103 Set pSocket
= New AuroNet
68 104 Set ppSocket
= New AuroNet
69 105 pSocket
.Direccion
= PaginaIP
70 106 ppSocket
.Direccion
= "www.google.com"
71 '------------------------
73 '------------------------
74 'Fichero INI con las opciones del programa
75 108 rINI_OPCIONES
= App
.Path
& "\Reseter.ini"
76 'Fichero INI con los códigos de reseteo para los routers
77 109 rINI_ROUTERS
= App
.Path
& "\Routers.ini"
78 '------------------------
79 110 Quieto
= LeerINI("Opciones", "Quieto", False)
80 'Será que es mejor no iniciar el Objeto IE?
81 'Esto es util cuando se ha desinstalado el Explorer o en Wine
82 111 NoIE
= LeerINI("Opciones", "NoIE", False)
83 11 ModoLinux
= LeerINI("Opciones", "Linux:Compatibilidad", False)
84 '------------------------
88 '------------------------
89 114 Registrar
"Iniciando Reseter: " & App
.Major
& "." & App
.Minor
& "." & App
.Revision
& " " & EstadoVer
90 115 Registrar
"Propiedad de svcommunity.org, todosv.com y untercio.net"
91 116 Registrar
"www.svcommunity.org/forum/index.php?topic=25095.0"
92 117 Registrar
"www.todosv.com/index.php?showtopic=331"
93 118 Registrar
"Información del programa en:"
94 119 Registrar
"IP pública por " & ObtenerDominio(PaginaIP
)
96 '------------------------
99 121 Registrar
"+-Se omitió la creacion del Objeto IE; NoIE=-1"
104 123 Registrar
"+IP Local: " & pSocket
.IpLocal
105 124 Registrar
"+IP Gateway: " & EthGateWay
107 126 Registrar
"Cargando lista de dispositivos soportados"
108 127 Obtener_Lista_Externa
109 128 frmPrincipal
.ComReset
.Text
= Predefinido
111 '------------------------
112 129 Registrar
"Comprobando si existe XMR..."
113 130 dXMR
= App
.Path
& "\XMR.exe"
115 131 If Dir
$(dXMR) = vbNullString
Then
116 132 Registrar
"=>XMR no pudo ser encontrado"
119 134 Registrar
"=>XMR encontrado y listo!"
123 '------------------------
125 '------------------------
126 136 Registrar
"Reestableciendo interfaz"
127 137 frmPrincipal
.chkAvanzado
.Value
= LeerINI("Interfaz", "MAvanzado", Unchecked
)
128 138 frmPrincipal
.chkTerminal
.Value
= LeerINI("Interfaz", "MTerminal", Unchecked
)
129 139 frmPrincipal
.txtNumero
.Text
= LeerINI("Opciones", "Telefono", vbNullString
)
131 140 Umbral_Desconexion
= 30000
133 '------------------------
134 'Verificar si hay router predefinido y proceder
135 '------------------------
136 141 If HayPredefinido
= True Then
137 142 Registrar
"Router predefinido, 10segs. para reseteo o cancelar"
138 143 frmPrincipal
.cmdPredefinir
.Caption
= "Cancelar"
139 144 frmPrincipal
.cmdReset
.Enabled
= False
140 145 frmPrincipal
.ComReset
.Enabled
= False
141 146 TiempoEx
.StartTimer
142 147 TiempoEx2
.StartTimer
144 'Esperamos los 10segs ó que la persona presione cancelar
145 148 Do Until TiempoEx
.Elapsed
> 10000 Or NetError
= True
147 150 frmPrincipal
.lblTW
.Caption
= Fix((10000 - TiempoEx
.Elapsed
) / 1000)
149 151 If TiempoEx2
.Elapsed
> 1000 Then
151 153 TiempoEx2
.StartTimer
156 154 TiempoEx2
.EndTimer
158 'Si no presionó cancelar
159 155 If Not NetError
Then
160 Registrar
"{[PRE]:Iniciando reseteo predefinido}"
162 Registrar
"{[PRE]:Terminando programa}"
166 'Si presionó cancelar
167 159 Registrar
"Se ha cancelado el reseteo automatico"
172 161 TiempoEx
.EndTimer
173 162 frmPrincipal
.cmdReset
.Enabled
= True
174 163 frmPrincipal
.ComReset
.Enabled
= True
176 '------------------------
177 165 Registrar
"Reseter tardó " & Round(Tiempo
.Elapsed
/ 1000, 2) & "segs. en cargar"
181 Controlar_Error Erl
, Err
.Description
, "Reseter.Global.main.Ref 12/2/2008 : 09:38:35"
186 Public Sub Reiniciar()
188 On Error GoTo Reiniciar_Err
191 Dim Detectado
As Boolean
192 'Reseteamos las variables.
195 'Verificamos si existe el objeto IE y verificamos si debe o no
197 101 If IE Is
Nothing And m_Datos
.tipoAcceso
= web
Then
199 103 Registrar
"!!!No hay objeto IE porque se especificó NoIE=-1"
201 104 Registrar
"!!!Por alguna causa el objeto IE no esta!"
205 'Verificamos el tipo de operación [Web | Telnet | AuroNet]
207 105 Select Case m_Datos
.tipoAcceso
209 Case Is
= e_Acceso
.web
210 106 Registrar
"+-Será un reseteo via WEB"
213 108 Case Is
= e_Acceso
.telnet
214 109 Registrar
"+-Será un reseteo via Telnet"
217 111 Case Is
= e_Acceso
.auro
218 112 Registrar
"+-Será un reseteo via WEB/AuroNet"
222 'Si ocurrió algún error en el reinicio
223 114 If NetError
= True Then
224 115 Registrar
"!!! Ha ocurrido un error critico y el reseteo no continuará"
228 'Esperamos la reconexión
229 116 If m_Datos
.asumirDes
Or ModoLinux
Then
230 117 Registrar
"+--Esperando " & Fix((Umbral_Desconexion
/ 1000)) & "Segs. para asumir des/conexión de router"
231 118 Tiempo
.StartTimer
235 120 frmPrincipal
.lblTW
.Caption
= Fix((Umbral_Desconexion
- Tiempo
.Elapsed
) / 1000)
236 121 Loop Until Tiempo
.Elapsed
> Umbral_Desconexion
Or NetError
Or GetNetConnectString
= False
240 123 If NetError
Then Exit Sub
242 124 Registrar
"+--Esperando " & Fix(Umbral_Desconexion
/ 1000) & " segundos para desconexión de router"
243 125 Tiempo
.StartTimer
247 127 frmPrincipal
.lblTW
.Caption
= Fix((Umbral_Desconexion
- Tiempo
.Elapsed
) / 1000)
248 128 Loop Until Tiempo
.Elapsed
> Umbral_Desconexion
Or NetError
Or GetNetConnectString
= False
252 130 If NetError
Or Tiempo
.Elapsed
> Umbral_Desconexion
Then
253 131 Registrar
"+---El router nunca se desconectó o ocurrió otro error"
259 134 Registrar
"+--Esperando " & Fix(Umbral_Desconexion
/ 1000) & "segundos para reconexión de router"
260 135 Tiempo
.StartTimer
264 137 frmPrincipal
.lblTW
.Caption
= Fix((Umbral_Desconexion
- Tiempo
.Elapsed
) / 1000)
265 138 Loop Until Tiempo
.Elapsed
> Umbral_Desconexion
Or NetError
Or GetNetConnectString
= True
269 140 If NetError
Or Tiempo
.Elapsed
> Umbral_Desconexion
Then
270 141 Registrar
"+---El router nunca se conectó o ocurrió otro error"
277 'Esperar 5 minutos a que se recupere el internet
278 144 Registrar
"+--Esperando recuperación de internet (máximo " & (Umbral_EsperarInternetMax
/ 60000) & "minutos)"
279 145 Tiempo
.StartTimer
280 146 TiempoEx
.StartTimer
281 Dim dTemporizador
As Long
282 147 dTemporizador
= SetTimer(0, 0, 1000, AddressOf lpActualizar
)
283 148 Detectado
= HayInternet
285 149 If Not Detectado
Then
287 150 Do Until (Tiempo
.Elapsed
> Umbral_EsperarInternetMax
) Or NetError
290 'Chequear si ya hay internet
291 152 If TiempoEx
.Elapsed
> Umbral_ChequeoInternet
Then
292 153 Detectado
= HayInternet
294 154 If Detectado
Then Exit Do
301 155 KillTimer
0, dTemporizador
303 157 TiempoEx
.EndTimer
305 158 If Detectado
And NetError
= False Then
306 'Si hay internet entonces verificamos si la IP cambió
307 '1: Si no cambió entonces reseteamos el router de nuevo
308 '2: siempre y cuando no supere cierto limite de reintentos.
311 160 If bIP
.Cambio
= True Then
312 161 Registrar
"++La IP no cambió, reintentando reseteo en " & (Umbral_Reintento
/ 1000) & "Segs."
313 162 Intentos_Realizados
= Intentos_Realizados
+ 1
315 'Como no cambió reintentamos el reseteo
316 163 If Intentos_Realizados
> Intentos_Maximos
Then
317 'Si ya no nos quedan intentos...
318 164 Registrar
"++-Se han hecho " & Intentos_Realizados
& " intentos sin exito, deteniendo"
319 165 Registrar
"+Se han cancelado los reintentos aútomaticos"
322 'Si aún nos quedan intentos...
323 166 Tiempo
.StartTimer
324 'Esperar 30segs. para reintentar reseteo
325 167 Registrar
"+Esperando " & Fix(Umbral_Reintento
/ 1000) & " segundos para intento #" & Intentos_Realizados
+ 1
329 169 frmPrincipal
.lblTW
.Caption
= Fix((Umbral_Desconexion
- Tiempo
.Elapsed
) / 1000)
330 170 Loop Until Tiempo
.Elapsed
> Umbral_Reintento
Or NetError
332 171 If Not NetError
Then
339 173 Registrar
"+El cambió fue satisfactorio"
341 174 If dXMR_ok
And frmPrincipal
.txtNumero
.Text
<> vbNullString
Then
342 175 Registrar
"Enviando mensaje de exito a usuario"
343 176 XMR_Enviar frmPrincipal
.txtNumero
.Text
, "El reseteo fue exitoso, a las " & Now
& " | nueva IP: " & bIP
.IP_Actual
345 177 Registrar
"No habia numero para notificacion de usuario"
348 178 frmPrincipal
.lblTW
.Caption
= "Exito"
352 'Si no se detectó para nada el internet
353 179 Registrar
"+El tiempo de espera se agotó y no se detecto conexión."
354 180 Registrar
"++El servidor " & PaginaIP
& " puede estar caido."
355 181 Registrar
"+Se han cancelado los reintentos aútomaticos"
357 183 frmPrincipal
.lblTW
.Caption
= "Error"
360 ' Reseteamos algunas variables
361 184 Umbral_Desconexion
= 30000
365 Controlar_Error Erl
, Err
.Description
, "Reseter.Global.Reiniciar.Ref 12/2/2008 : 09:38:34"
370 Public Function GuardarRegistro() As String
372 On Error GoTo GuardarRegistro_Err
376 Static ocupado
As Boolean
378 100 If ocupado
Then Exit Function
381 103 Buffer
= frmPrincipal
.txtSalida
.Text
382 104 Open App
.Path
& "\" & Day(Now
) & "-" & Month(Now
) & ".txt" For Append Access Write
As #i
383 105 Print #i
, CStr(Now
)
384 106 Print #i
, CStr(Buffer
)
386 108 GuardarRegistro
= (App
.Path
& "\" & Day(Now
) & "-" & Month(Now
) & ".txt")
391 Controlar_Error Erl
, Err
.Description
, "Reseter.Global.GuardarRegistro.Ref 12/2/2008 : 09:38:34"
397 Public Sub Controlar_Error(linea
As Long, _
398 descripcion
As String, _
400 100 Registrar
"¦¦¦""" & descripcion
& """, erl #" & linea
& " - """ & lugar
& """"
406 106 If MsgBox("Ocurrió el error """ & descripcion
& """, en linea #" & linea
& " de """ & lugar
& """" & vbNewLine
& "Por favor notifica de este error al tema especifico de reseter en svcommunity.org ó todosv.com" & vbNewLine
& "Se ha guardado un registro de error en """ & GuardarRegistro
& """ por favor envielo a los creadores" & vbNewLine
& "¿Desea terminar la aplicación?", vbCritical
+ vbYesNo
) = vbYes
Then End
411 Public Sub Predefinir(Valor
As Boolean)
413 On Error GoTo Predefinir_Err
415 100 EscribirINI
"Opciones", "BPredefinido", CStr(CInt(Valor
))
416 101 EscribirINI
"Opciones", "Predefinido", frmPrincipal
.ComReset
.Text
420 Controlar_Error Erl
, Err
.Description
, "Reseter.Global.Predefinir.Ref 12/2/2008 : 09:38:34"
425 Public Function Predefinido() As String
427 On Error GoTo Predefinido_Err
429 100 Predefinido
= LeerINI("Opciones", "Predefinido", "Escoja su router/modem")
433 Controlar_Error Erl
, Err
.Description
, "Reseter.Global.Predefinido.Ref 12/2/2008 : 09:38:34"
438 Public Function ObtenerDominio(URL
As String) As String
440 On Error GoTo ObtenerDominio_Err
443 100 Buffer
= InStr(8, URL
, "/")
445 101 If Buffer
> 0 Then ObtenerDominio
= Replace
$(Mid$(URL, 1, Buffer
- 1), "http://", vbNullString
) Else ObtenerDominio
= URL
449 Controlar_Error Erl
, Err
.Description
, "Reseter.Global.ObtenerDominio.Ref 12/2/2008 : 09:38:34"
454 Public Function HayPredefinido() As Boolean
456 On Error GoTo HayPredefinido_Err
458 100 HayPredefinido
= LeerINI("Opciones", "BPredefinido", False)
462 Controlar_Error Erl
, Err
.Description
, "Reseter.Global.HayPredefinido.Ref 12/2/2008 : 09:38:34"
467 Public Sub XMR_Enviar(Numero
As String, _
469 'Gracias a Olatin por la idea de enviar mensaje con notificaciones!.
471 On Error GoTo XMR_Enviar_Err
473 100 ShellExecute frmPrincipal
.hWnd
, "", dXMR
& " /x n=" & Numero
& "|m=" & Mensaje
& "|f=Reseter 4.0", "", "", 0
477 Controlar_Error Erl
, Err
.Description
, "Reseter.Global.XMR_Enviar.Ref 12/2/2008 : 09:38:34"
482 Public Sub Error_Cel()
484 On Error GoTo Error_Cel_Err
487 100 If dXMR_ok
And frmPrincipal
.txtNumero
.Text
<> vbNullString
Then
488 101 Registrar
"Enviando mensaje de error a usuario"
489 102 XMR_Enviar frmPrincipal
.txtNumero
.Text
, "El reseteo NO fue exitoso, fallo ocurrido en " & Now
495 Controlar_Error Erl
, Err
.Description
, "Reseter.Global.Error_Cel.Ref 12/2/2008 : 09:38:34"
500 Public Sub Procesar_Codigo()
501 'Primero quebramos el codigo en un array, donde cada elemento contendrá una linea de codigo básico.
503 On Error GoTo Procesar_Codigo_Err
505 Dim A_Codigo() As String
507 Dim cTimeEspera
As New cTimer
508 100 A_Codigo
= Split(m_Datos
.codigo
, Chr(254))
510 101 For i
= 0 To UBound(A_Codigo
)
511 'Saltar los comentarios
512 If Left(A_Codigo(i
), 2) = "//" Then Registrar
"PreProcesador: Comentario: '" & Mid$(A_Codigo(i), 3) & "'"
513 'Reemplazar variables
514 A_Codigo(i
) = Replace
$(A_Codigo(i), "$$GATEWAY$$", EthGateWay)
515 '#########################################################################################
517 '#########################################################################################
518 'El codigo dice que tenemos que reiniciar?, bien, "tratemos
"
519 102 If A_Codigo(i) = "objetivo
.reiniciar
" Then
520 103 Registrar "PreProcesador
: 'objetivo.reiniciar' ejecutando 'Reiniciar'"
522 105 Registrar
"PreProcesador: 'objetivo.reiniciar' ejecutado."
525 'El codigo dice que tenemos que ejecutemos el procesador Res_web?
526 106 If A_Codigo(i
) = "web.procesar" Then
527 107 Registrar
"PreProcesador: 'web.procesar' ejecutando 'Res_Web'"
529 109 Registrar
"PreProcesador: 'web.procesar' ejecutado."
532 'El codigo diceque tenemos que esperar X segundos antes de seguir?
533 110 If InStr(1, A_Codigo(i
), "mi.esperar=") Then
534 111 TiempoMax
= CDbl(Mid$(A_Codigo(i), InStr(1, A_Codigo(i
), "=") + 1)) * 1000
535 112 Registrar
"PreProcesador: 'mi.esperar' iniciada [" & TiempoMax
& "]"
536 113 cTimeEspera
.StartTimer
540 115 Loop Until cTimeEspera
.Elapsed
> TiempoMax
542 116 Registrar
"PreProcesador: comando 'mi.esperar' concluido"
545 '#########################################################################################
546 '#########################################################################################
547 '#########################################################################################
549 '#########################################################################################
550 'El codigo dice que tenemos que hacer clic en la direccion indicada?
551 117 If A_Codigo(i
) = "web.accion.clic" Then
552 118 m_Datos
.accionTipo
= ed_clic
553 119 Registrar
"PreProcesador: 'web.accion.clic' traducido a 'm_Datos.accionTipo=ed_clic'"
556 'El codigo dice que solo tenemos que navegar la direccion indicada? (codigo JAVA)
557 120 If A_Codigo(i
) = "web.accion.java" Then
558 121 m_Datos
.accionTipo
= ed_java
559 122 Registrar
"PreProcesador: 'web.accion.java' traducido a 'm_Datos.accionTipo=ed_java'"
562 'El codigo dice que solo tenemos que navegar la direccion indicada?
563 123 If A_Codigo(i
) = "web.accion.navegar" Then
564 124 m_Datos
.accionTipo
= ed_navegar
565 125 Registrar
"PreProcesador: 'web.accion.navegar' traducido a 'm_Datos.accionTipo=ed_navegar'"
568 'El codigo dice que tenemos que llenar información en la direccion y posición indicada?
569 126 If InStr(1, A_Codigo(i
), "web.accion.llenar") Then
570 127 m_Datos
.accionTipo
= ed_llenar
571 128 Registrar
"PreProcesador: 'web.accion.llenar' traducido a 'm_Datos.accionTipo=ed_llenar'"
574 'Debemos asumir que el router se desconectará internamente?.
575 129 If InStr(1, A_Codigo(i
), "objetivo.asumir.desconexion=") Then
576 130 m_Datos
.asumirDes
= CBool(Mid$(A_Codigo(i), InStr(1, A_Codigo(i
), "=") + 1))
577 131 Registrar
"PreProcesador: 'objetivo.asumir.desconexion' traducido a 'm_Datos.asumirDes=" & m_Datos
.asumirDes
& "'"
580 'El codigo dice que tenemos que renovar despues de la operación?
581 132 If InStr(1, A_Codigo(i
), "red.renovar=") Then
582 133 m_Datos
.renovar
= CBool(Mid$(A_Codigo(i), InStr(1, A_Codigo(i
), "=") + 1))
583 134 Registrar
"PreProcesador: 'red.renovar' traducido a 'm_Datos.renovar=" & m_Datos
.renovar
& "'"
586 'El codigo dice que no tenemos que navegar en reiniciar.res_web y en web.procesar?
587 135 If InStr(1, A_Codigo(i
), "web.navegar=") Then
588 136 flag_Navegar
= CBool(Mid$(A_Codigo(i), InStr(1, A_Codigo(i
), "=") + 1))
589 137 Registrar
"PreProcesador: 'web.navegar' traducido a 'flag_Navegar=" & flag_Navegar
& "'"
592 'El codigo dice que tenemos que cambiar el limite para asumir desconexion -temporal-?
593 'mi.umbral.desconexion=<TIEMPO EN SEGUNDOS>
594 138 If InStr(1, A_Codigo(i
), "mi.umbral.desconexion=") Then
595 139 Umbral_Desconexion
= Mid$(A_Codigo(i), InStr(1, A_Codigo(i
), "=") + 1) * 1000
596 140 Registrar
"PreProcesador: 'mi.umbral.desconexion' traducido a 'Umbral_Desconexion=" & Umbral_Desconexion
& "'"
599 '#########################################################################################
600 '#########################################################################################
601 '#########################################################################################
602 ' Ajustes de parametros
603 '#########################################################################################
604 'El codigo dice que tenemos que ajustar las opciones para procesar telnet?
605 'telnet=<COMANDOS SEPARADOS POR ";">
606 141 If InStr(1, A_Codigo(i
), "telnet.comando=") Then
607 142 m_Datos
.tipoAcceso
= telnet
608 143 m_Datos
.accionEX
= Mid$(A_Codigo(i), InStr(1, A_Codigo(i
), "=") + 1)
609 144 Registrar
"PreProcesador: 'telnet' traducido a 'm_Datos.accionEX=" & m_Datos
.accionEX
& "'"
612 'El codigo dice que tenemos que ajustar las opciones para procesar web?
613 145 If InStr(1, A_Codigo(i
), "web.url=") Then
614 146 m_Datos
.accionEX
= Mid$(A_Codigo(i), InStr(1, A_Codigo(i
), "=") + 1)
615 147 m_Datos
.tipoAcceso
= web
616 148 Registrar
"PreProcesador: 'web.url' traducido a 'm_Datos.accionEX=" & m_Datos
.accionEX
& "'"
619 'El codigo nos da datos para EX2
620 149 If InStr(1, A_Codigo(i
), "web.datos=") Then
621 150 m_Datos
.accionEX2
= Mid$(A_Codigo(i), InStr(1, A_Codigo(i
), "=") + 1)
622 151 Registrar
"PreProcesador: 'web.datos' traducido a 'm_Datos.accionEX2=" & m_Datos
.accionEX2
& "'"
625 'El codigo especifica el puerto a usar?
626 152 If InStr(1, A_Codigo(i
), "puerto=") Then
627 153 m_Datos
.puerto
= Mid$(A_Codigo(i), InStr(1, A_Codigo(i
), "=") + 1)
628 154 Registrar
"PreProcesador: 'puerto' traducido a 'm_Datos.puerto=" & m_Datos
.puerto
& "'"
631 'El codigo especifica el control a usar?
632 155 If InStr(1, A_Codigo(i
), "web.control=") Then
633 156 m_Datos
.nCont
= Mid$(A_Codigo(i), InStr(1, A_Codigo(i
), "=") + 1)
634 157 Registrar
"PreProcesador: 'web.control' traducido a 'm_Datos.nCont=" & m_Datos
.nCont
& "'"
637 'El codigo especifica el formulario a usar?
638 158 If InStr(1, A_Codigo(i
), "web.formulario=") Then
639 159 m_Datos
.nForm
= Mid$(A_Codigo(i), InStr(1, A_Codigo(i
), "=") + 1)
640 160 Registrar
"PreProcesador: 'web.formulario' traducido a 'm_Datos.nForm=" & m_Datos
.nForm
& "'"
643 'El codigo especifica el usuario a usar?
644 161 If InStr(1, A_Codigo(i
), "web.usuario=") Then
645 162 m_Datos
.usuario
= Mid$(A_Codigo(i), InStr(1, A_Codigo(i
), "=") + 1)
646 163 Registrar
"PreProcesador: 'web.usuario' traducido a 'm_Datos.usuario=" & m_Datos
.usuario
& "'"
649 'El codigo especifica la clave a usar?
650 164 If InStr(1, A_Codigo(i
), "web.clave=") Then
651 165 m_Datos
.clave
= Mid$(A_Codigo(i), InStr(1, A_Codigo(i
), "=") + 1)
652 166 Registrar
"PreProcesador: 'clave' traducido a 'm_Datos.clave=" & m_Datos
.clave
& "'"
655 'El codigo especifica la dirección base a usar?
656 167 If InStr(1, A_Codigo(i
), "objetivo.ip=") Then
657 168 m_Datos
.base
= Mid$(A_Codigo(i), InStr(1, A_Codigo(i
), "=") + 1)
658 169 Registrar
"PreProcesador: 'base' traducido a 'm_Datos.base=" & m_Datos
.base
& "'"
661 '#########################################################################################
662 '#########################################################################################
668 Controlar_Error Erl
, Err
.Description
, "Reseter.Global.Procesar_Codigo.Ref 12/2/2008 : 09:38:34"
673 Public Function HayInternet() As Boolean
675 On Error GoTo HayInternet_Err
678 100 If m_Datos
.renovar
= True Then RenovarLAN
679 101 Registrar
"+---Chequeando conexión a internet... espere"
682 103 If ppSocket
.HTML_CONSULTAR
Then
683 104 Registrar
"+----Chequeo -> Se detectó internet"
684 105 HayInternet
= True
686 106 Registrar
"+----Chequeo -> Aún no hay internet"
687 107 TiempoEx
.StartTimer
693 Controlar_Error Erl
, Err
.Description
, "Reseter.Global.HayInternet.Ref 12/2/2008 : 09:38:34"
698 Public Sub Restablecer_Todo()
700 On Error GoTo Restablecer_Todo_Err
702 100 flag_Navegar
= True
703 101 TelnetComandos
= Split("")
706 104 Intentos_Realizados
= 0
711 108 .accionTipo
= ed_clic
712 109 .asumirDes
= False
721 118 .tipoAcceso
= web
727 Restablecer_Todo_Err:
728 Controlar_Error Erl
, Err
.Description
, "Reseter.Global.Restablecer_Todo.Ref 12/2/2008 : 09:38:34"
733 Public Sub Terminar()
735 On Error GoTo Terminar_Err
737 100 Destruir_Conexion
738 101 EscribirINI
"Opciones", "Quieto", CStr(CInt(Quieto
))
739 102 EscribirINI
"Opciones", "NoIE", CStr(CInt(NoIE
))
740 103 EscribirINI
"Opciones", "Telefono", CStr(frmPrincipal
.txtNumero
.Text
)
741 10 EscribirINI
"Opciones", "Linux:Compatibilidad", CStr(CInt(ModoLinux
))
742 104 Set pSocket
= Nothing
743 105 Set ppSocket
= Nothing
746 106 For Each f
In Forms
754 Controlar_Error Erl
, Err
.Description
, "Reseter.Global.Terminar.Ref 12/2/2008 : 09:38:34"