ayuda cargar datos desde txt para Ie
Publicado: 14 Dic 2010, 02:33
hola de nuevo
gracias por la ayuda ya me ha quedado el programa como queria y he depurado algunas cosillas
el punto es que en la cuestiobn automatizando el IE como puedo hacer que se carguen los datos user pass etc desde un block de notas
aqui dejo el codigo
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
#Region ### START Koda GUI section ### Form=
$_1 = GUICreate("TETO", 952, 618, 178, 187)
$TELCEL = GUICtrlCreateButton("TELCEL", 856, 24, 75, 25, $WS_GROUP)
$MOVISTAR = GUICtrlCreateButton("MOVISTAR", 856, 64, 75, 25, $WS_GROUP)
$CURP = GUICtrlCreateButton("CURP", 856, 104, 75, 25, $WS_GROUP)
$EXCEL = GUICtrlCreateButton("EXCEL", 856, 144, 75, 25, $WS_GROUP)
$WORD = GUICtrlCreateButton("WORD", 856, 184, 75, 25, $WS_GROUP)
$DOCUMENTOS = GUICtrlCreateButton("DOCUMENTOS", 856, 224, 91, 25, $WS_GROUP)
$Lynk = GUICtrlCreateButton("Codigo", 856, 264, 75, 25, $WS_GROUP)
$APAGAR = GUICtrlCreateButton("APAGAR", 864, 576, 75, 25, $WS_GROUP)
$object = ObjCreate("Shell.Explorer.2")
$object_ctrl = GUICtrlCreateObj($object, 10, 10, 800, 800)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
case $TELCEL
_IENavigate($object, "https://recargamigoweb.telcel.com/distr ... gin.action")
$user= _IEGetObjByName ($object, "user")
$password= _IEGetObjByName ($object, "password")
$username= _IEGetObjByName ($object, "username")
$oBoton= _IEGetObjByName ($object , "bsave")
_IEFormElementSetValue ($user, "1111111")
_IEFormElementSetValue ($password, "1111")
_IEFormElementSetValue ($username, "11111")
_IEAction($oBoton,"click")
Case $MOVISTAR
_IENavigate($object, "http://sre.movistar.com.mx/sre/")
$o_form = _IEFormGetObjByName($object , "login")
$o_login = _IEFormElementGetObjByName($o_form, "user")
$o_password = _IEFormElementGetObjByName($o_form, "password")
$oBoton= _IEGetObjByName ($object , "submit")
_IEFormElementSetValue($o_login, "11111111")
_IEFormElementSetValue($o_password, "111111111")
_IEFormSubmit($o_form)
_IEAction($oBoton,"click")
Case $CURP
_IENavigate($object, "http://www.gobernacion.gob.mx/CurpPS_HT ... 81215.html")
Case $DOCUMENTOS
$object.navigate("file://c:\users\Vlad\Documents\")
Case $EXCEL
Run("C:\Program Files\Microsoft Office\Office14\excel.exe")
Case $WORD
Run("C:\Program Files\Microsoft Office\Office14\WINWORD.exe")
Case $Lynk
Run("C:\LINK.exe")
Case $APAGAR
Run("C:\WINDOWS\SYSTEM32\shutdown -s")
Case $GUI_EVENT_CLOSE
EndSwitch
WEnd
de antemano muchas gracoas
gracias por la ayuda ya me ha quedado el programa como queria y he depurado algunas cosillas
el punto es que en la cuestiobn automatizando el IE como puedo hacer que se carguen los datos user pass etc desde un block de notas
aqui dejo el codigo
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
#Region ### START Koda GUI section ### Form=
$_1 = GUICreate("TETO", 952, 618, 178, 187)
$TELCEL = GUICtrlCreateButton("TELCEL", 856, 24, 75, 25, $WS_GROUP)
$MOVISTAR = GUICtrlCreateButton("MOVISTAR", 856, 64, 75, 25, $WS_GROUP)
$CURP = GUICtrlCreateButton("CURP", 856, 104, 75, 25, $WS_GROUP)
$EXCEL = GUICtrlCreateButton("EXCEL", 856, 144, 75, 25, $WS_GROUP)
$WORD = GUICtrlCreateButton("WORD", 856, 184, 75, 25, $WS_GROUP)
$DOCUMENTOS = GUICtrlCreateButton("DOCUMENTOS", 856, 224, 91, 25, $WS_GROUP)
$Lynk = GUICtrlCreateButton("Codigo", 856, 264, 75, 25, $WS_GROUP)
$APAGAR = GUICtrlCreateButton("APAGAR", 864, 576, 75, 25, $WS_GROUP)
$object = ObjCreate("Shell.Explorer.2")
$object_ctrl = GUICtrlCreateObj($object, 10, 10, 800, 800)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
case $TELCEL
_IENavigate($object, "https://recargamigoweb.telcel.com/distr ... gin.action")
$user= _IEGetObjByName ($object, "user")
$password= _IEGetObjByName ($object, "password")
$username= _IEGetObjByName ($object, "username")
$oBoton= _IEGetObjByName ($object , "bsave")
_IEFormElementSetValue ($user, "1111111")
_IEFormElementSetValue ($password, "1111")
_IEFormElementSetValue ($username, "11111")
_IEAction($oBoton,"click")
Case $MOVISTAR
_IENavigate($object, "http://sre.movistar.com.mx/sre/")
$o_form = _IEFormGetObjByName($object , "login")
$o_login = _IEFormElementGetObjByName($o_form, "user")
$o_password = _IEFormElementGetObjByName($o_form, "password")
$oBoton= _IEGetObjByName ($object , "submit")
_IEFormElementSetValue($o_login, "11111111")
_IEFormElementSetValue($o_password, "111111111")
_IEFormSubmit($o_form)
_IEAction($oBoton,"click")
Case $CURP
_IENavigate($object, "http://www.gobernacion.gob.mx/CurpPS_HT ... 81215.html")
Case $DOCUMENTOS
$object.navigate("file://c:\users\Vlad\Documents\")
Case $EXCEL
Run("C:\Program Files\Microsoft Office\Office14\excel.exe")
Case $WORD
Run("C:\Program Files\Microsoft Office\Office14\WINWORD.exe")
Case $Lynk
Run("C:\LINK.exe")
Case $APAGAR
Run("C:\WINDOWS\SYSTEM32\shutdown -s")
Case $GUI_EVENT_CLOSE
EndSwitch
WEnd
de antemano muchas gracoas