易截截图软件、单文件、免安装、纯绿色、仅160KB

Delphi用WebBrowser编程 自动登录操作

Delphi用WebBrowser编程-自动登录操作
2009年08月18日 星期二 00:39
利用Delphi的Olevariant类型
--------------------------------------------------------------------------------
单个frames的输入
var
o : Olevariant;
begin
o := WebBrowser.OleObject.document.all.item('LoginUserID',0);    //找到登录用户名的输入框
o.value := 'TEST';
o := WebBrowser.oleobject.document.all.item('LoginPassword',0); //找到登录密码的输入框
o.value := 'TEST'
WebBrowser.oleobject.document.Forms.Item(0, 0).submit;           //第一个表单提交
{
o :=WebBrowser.oleobject.document.all.item('Login',0);           //或者用指定表单名称提交
o.Click;   //点击操作,对其它对象也可同样操作
}
end;
多个frames的输入,FrameIndex为Frame的序号
var
o : Olevariant;
begin
//找到登录用户名的输入框
o := WebBrowser.oleobject.document.documentelement.document.frames.item(FrameIndex).document.all.item('LoginUserID',0);
o.value := 'TEST';
//找到登录密码的输入框
o := WebBrowser.oleobject.document.documentelement.document.frames.item(FramIndex).document.all.item('LoginPassword',0);
o.value := 'TEST'
//第一个表单提交
WebBrowser.oleobject.document.documentelement.document.frames.item(FramIndex).document.Forms.Item(0, 0).submit;
{
//或者用指定表单名称提交
o :=WebBrowser.oleobject.document.documentelement.document.frames.item(FramIndex)..document.all.item('Login',0);
o.Click;    //点击操作,对其它对象也可同样操作
}
end;


相关文档:

C#学习及与delphi的比较(一)

刚开始很不习惯c#的风格,哎,先入为主啊,delphi习惯了,{}代替begin/end太扎眼。
属性方法的宣告和代码在一起,没有像delphi分interface/implementation,感觉太乱,都不知道一个class到底有几个方法。
每个属性和方法前面都要单独写private/protected/public,老天,c#是delphi之父设计的揶,怎么不学delphi写一个就行 ......

Delphi游戏开发网址大全[转贴]


Source Code
http://www.codefans.com/CodeList/Catalog_5_CodeTime_Desc_1.html
http://www.vscodes.com/sitemap.html
http://www.itlove.net/Soft/261/
DelphiX
http://www.micrel.cz/Dx/
http://www.delphi3d.net/index.php
http://www.pascalgamedevelopment.com/
http://www.2ccc.com/article.asp?articleid ......

delphi 获取指定文件的图标

前段时间因为项目需要,获取指定文件的图标,绕了很多弯子,现在弄出来了,跟大家共享下.
unit Unit1;
interface
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls,ShellAPI, ExtCtrls;
type
  TForm1 = class(TForm)
    l ......

Delphi编写系统服务二:系统服务和桌面程序的区别

 Delphi编写系统服务二:系统服务和桌面程序的区别 收藏
 Windows 2000/XP/2003等支持一种叫做“系统服务程序”的进程,系统服务和桌面程序的区别是:
系统服务不用登陆系统即可运行;
系统服务是运行在System Idle Process/System/smss/winlogon/services下的,而桌面程序是运行在Explorer下的; ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号