如何用delphi实现网页log in(150分)

L

leo_aj

Unregistered / Unconfirmed
GUEST, unregistred user!
各位:
我现在有一个问题,公司有一个login pgae, 我们需要每天login and log out. 想请问如何做成你个程序能够帮我logon. (说实话,我不经常迟到,哈哈)

网页是用ASP做的。中间有一个login box with user name and password. 只要大家能告诉我从何做起就行了。程序最好不用GUI, runing in the background. 另:网页在公司局域网。

thanks in advance
 
用intraweb做吧
 
如果是用GET方法提交user和password的,比较简单,直接用shellexecute打开一个地址为:ASP地址+参数(如:http://127.0.0.1/test.asp?user=test&pass=test) 的IE窗口就可以了;

如果是其他方法提交的,可以使用Twebbrowser控件,设名字为wb1:
1、把LOGIN的页面保存到本地(或只把其中的LOGIN FORM保存到本地的HTML格式的文本中);
2、把这个本地文件中的链接补全;
3、把LOGIN FORM中添加一个 target="_blank" 的代码;
4、用wb1打开这个文件,在完成事件里添加提交的代码,如:
wb1.OleObject.Document.myform.UserName.value:=mynane;
wb1.OleObject.Document.myform.Password.value:=mypass;
wb1.OleObject.Document.myform.submit();
这样,就会弹出登陆后的IE窗口;

你可以把你的程序做成隐藏的。
 
谢谢提示,我会尽快恢复
 
我感觉用 Indy 或 ICS 里的 Http 控件比较好,
我经常用这个东西。呵呵。
很不错的。
 
严重同意楼上的
再 加上 每天设置自动开机。。。
 
To netcore:

sorry for replyin your so late. i made this simple program by using shellexecute command. it does open the Internet explore, but not seems to log me in.
sample code:
username:=Edit1.text;
pwd:=Edit2.Text;
logtext:='http://'+username + ':' + Pwd + '@tt1s2/signin/signin.asp';
Return := ShellExecute(Handle, 'open', PChar(LogText), nil, nil, SW_SHOW);
//another shellexecute example
//shellexecute(Handle,'print',pchar('c:/log.txt'),nil,nil,SW_SHOWNORMAL)<=32 then
if Return > 32 then
showMessage('OK, done')
else
showMessage(InttoStr(Return));
can you give me any hint?

thanks in advance
 
also, would you explain how to use Twebbrowser控件 a little bit more. i don't know anything about webpage design.
2、把这个本地文件中的链接补全; ????
3、把LOGIN FORM中添加一个 target="_blank" 的代码;????

thanks
 
to wzca,
可否再说具体点?
 
用intraweb+數據庫做
 
在表单里的东东可以直接用request得到,用得着写在URL里嘛,而且写在那个里面一点安全性都没有
 
to mr netcore:
我试过webbrower component. 出现以下错误
EoleError: method 'myform' not support by automation object

any comments
 
to finalrinoa:

can u explain what to do then. pls
 
你没用过表单吗?我的QQ:65209834 lunart@sina.com
 
no, i didn't. can u send me an example. thanks
 
你的EMAIL多少啦,还有啊,你有没有QQ或MSN啊,在那个上说比较方便
 
sorry, i don't have qq, company blocked MSN messanger. my email: infosecure@free.net.nz.
or u can just tell me here.

thanks
 
那你先把那个login page发给我
 
哪位大哥,可以帮我看相关问题

http://www.delphibbs.com/delphibbs/listq.asp?room=7&amp;type=1&amp;sort=1&amp;query=&amp;userfrom=&amp;page=
 
ok, it is coming.

谢谢了
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
D
回复
0
查看
1K
DelphiTeacher的专栏
D
D
回复
0
查看
902
DelphiTeacher的专栏
D
I
回复
0
查看
580
import
I
顶部