|
本帖最后由 yiruirui 于 2010-8-30 09:22 编辑
自己GUI源码如下:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=C:\Documents and Settings\Administrator\桌面\ocr\form1.kxf
Dim $usename,$password
$Form1_1 = GUICreate("微薄登陆", 633, 447, 193, 125)
$Radio1 = GUICtrlCreateRadio("新浪微薄", 64, 64, 81, 33)
$Radio2 = GUICtrlCreateRadio("腾讯微薄", 159, 64, 81, 33)
$Group1 = GUICtrlCreateGroup("", 16, 104, 369, 297)
$Label1 = GUICtrlCreateLabel("用户账号", 24, 144, 52, 17)
$Label2 = GUICtrlCreateLabel("用户密码", 20, 259, 52, 17)
$input1=GUICtrlCreateInput("", 152, 136, 225, 21)
$input2=GUICtrlCreateInput("", 152, 240, 225, 21,BitOR($ES_LEFT, $ES_AUTOHSCROLL, $ES_LOWERCASE, $ES_PASSWORD))
$Button1 = GUICtrlCreateButton("登陆", 40, 328, 97, 41, 0)
$Button2 = GUICtrlCreateButton("退出", 264, 328, 97, 41, 0)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlSetState(-1, $GUI_HIDE)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
case $Button1
$usename=GUICtrlRead($input1) $password=GUICtrlRead($input2)
if $password=""Or $usename="" Then MsgBox(0,"错误","用户名或密码不能为空!")
case $Button2
Exit
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
新浪微薄首页:http://t.sina.com.cn/
#include <IE.au3>
$oIE = _IECreate ("http://t.sina.com.cn/")
$oForms = _IEFormGetCollection ($oIE)
MsgBox(0, "表单信息", "这个页面上共有" & @extended & "个表单")
For $Form In $oForms
MsgBox(0, "表单名称", $Form.name)
$oQuerys = _IEFormElementGetCollection ($Form)
For $Query In $oQuerys
MsgBox(0, "表单控件信息", "名称:"&$Query.name & " 类型:"&$Query.type)
Next
Next
这段代码得不到表单和控件,所以我不知道该如何提交我从GUI中获取的用户名和密码。
看了论坛中的邮箱登陆代码,可以从网页中获取表单和控件,但是这里得不到,我该如何解决?求指点,先谢谢大家! |
|