使用xml broker, 是delphi 内置的。例:
unit ShowXML;
interface
uses Classes HTTPApp Db DbClient Midas
XMLBrokr WebComp MidItems;
type
TCustomShowXMLButton = class(TXMLButton IScriptComponent)
protected
|
|
|||
{ IScriptComponent }
procedure AddElements(AddIntf: IAddScriptElements);
function GetSubComponents: TObject;
{ IWebContent implementation }
function ImplContent(Options: TWebContentOptions;
ParentLayout: TLayout): string; override;
end;
TShowXMLButton = class(TCustomShowXMLButton)
public
constructor Create(AOwner: TComponent); override;
published
property Custom;
property Style;
property StyleRule;
property Caption;
property XMLBroker;
property XMLUseParent;
end;
TShowDeltaButton = class(TCustomShowXMLButton)
public
constructor Create(AOwner: TComponent); override;
published
property Custom;
property Style;
property StyleRule;
property Caption;
property XMLBroker;
property XMLUseParent;
end;
implementation
uses sysutils MidProd;
resourcestring
sShowXML = 'Show XML';
sShowDelta = 'Show Delta';
procedure TCustomShowXMLButton.AddElements(
AddIntf: IAddScriptElements);
begin AddIntf.AddIncludeFile('xmlshow.js');
end;
function TCustomShowXMLButton.GetSubComponents: TObject;
begin
Result := nil;
end;
function TCustomShowXMLButton.ImplContent(Options: TWebContentOptions;
ParentLayout: TLayout): string;
var
Attrs: string;
Intf: ILayoutWebContent;
FormVarName: string;
RowSetVarName: string;
begin
AddQuotedAttrib(Attrs 'NAME' Name);
AddQuotedAttrib(Attrs 'STYLE' Style);
AddQuotedAttrib(Attrs 'CLASS' StyleRule);
AddQuotedAttrib(Attrs 'VALUE' Self.Caption);
AddCustomAttrib(Attrs Custom);
if Assigned(XMLData.XMLBroker) then
begin
FormVarName := XMLData.XMLBroker.SubmitFormVarName;
RowSetVarName := XMLData.XMLBroker.RowSetVarName(nil); // Row row set var name
end;
if not (coNoScript in Options.Flags) then
Result :=
Format(''#13#10
[Attrs RowSetVarName XMLMethodName sXMLReadyVar])
else
Result :=
Format(''#13#10
[Attrs]);
if Assigned(ParentLayout) and ParentLayout.GetInterface(ILayoutWebContent Intf) then
Result := Intf.LayoutButton(Result GetLayoutAttributes);
end;
{ TShowXMLButton }
constructor TShowXMLButton.Create(AOwner: TComponent);
begin
inherited;
DefaultCaption := sShowXML;
XMLMethodName := 'root'; end;
{ TShowDeltaButton }
constructor TShowDeltaButton.Create(AOwner: TComponent);
begin
inherited;
DefaultCaption := sShowDelta;
XMLMethodName := 'getDelta()';
end;
另一种方法使用msxml.dll 如下:
....
....
procedure TDHEDForm.OpenBtnClick(Sender: TObject);
var
pVIn : OleVariant;
Prompt : OleVariant;
begin
pVIn := '';
Prompt := True;
DHtmlEdit1.LoadDocument(pVIn Prompt);
end;
procedure TDHEDForm.SaveBtnClick(Sender: TObject);
var
vo vb : OleVariant;
begin
vo := DHTMLEdit1.CurrentDocumentPath;
if (vo <> '') then
begin
vb := false;
end
else
begin
vo := '';
vb := true;
end;
DHTMLEdit1.SaveDocument(vo vb);
end;
procedure TDHEDForm.SaveAsClick(Sender: TObject);
var
vo vb : OleVariant;
begin
vo := '';
vb := true;
DHTMLEdit1.SaveDocument(vo vb);
end;
...
·硬盘故障处理技巧 (890次浏览)
·明基显示器FP71G+黑屏维修方法详解 (831次浏览)
·实修电脑故障三则 (596次浏览)
·BIOS里都找不到硬盘修复一例 (514次浏览)
·主板电路故障修复一例 (486次浏览)
·液晶显示器常见故障的维修 (350次浏览)
·USB鼠标失灵的解决办法 (324次浏览)
·PC3000 for Windows修复笔记本硬盘时的COM线 (312次浏览)
·Dalas 2.0使用说明(硬盘坏道的检测与修复) (308次浏览)
·NF5内置防火墙导致下载出错 06-09
·“雕”刻时代 认识飞利浦光雕全能DVD刻录机 05-04
·散热问题面面观!刻录失败故障分析与解决 05-04
·刻录机也“超频” 感受华硕光存储超速刻录 05-04
·维护是关键!刻录机不读/刻盘故障实例排除 05-04
·何必再麻烦别人 光驱常见故障自己动手解决 05-04
·实修电脑故障三则 05-03
·解决打印机怪异提示之打印任务无法停止 05-03
·解决打印机怪异提示之打印端口不匹配 05-03
|
|||
| ·ACDSEE专题教程-下载使用 ·迅雷专题教程-下载使用 ·Windows XP频道 ·Windows Vista频道 ·Windows 2000频道 ·win2003频道 ·Freebsd频道 ·Oracle频道 |
·Linux频道 ·Windows频道 ·邮件服务器专题 ·协议大全 ·数据恢复指南教程 ·FreeBSD使用教程 ·Linux数据库宝典 ·Linux基础知识 |
||
| · 秘密:Vista隐蔽的动态屏保 · 腾讯开发新电子宠物--QQ熊 · 惠普否认2999元PC有价无货 |
· 驱逐Win系统“流氓”文件 · WinXP中获取未使用的IP地址 · 尝试format C:格式化硬盘? |
| · 在DOS下恢复回收站中的文件 · 拯救WinXP崩溃的救命稻草 · Linux系统中超级权限的应用 |
· 搜狗PK谷歌:谁能代言拼... · 昨日重现,一键GHOST轻松.. · 实现Web迅雷在空闲时杀毒 |
| · AVIFile函数制做AVI文件 · VC中链接动态链接库的方法 · 熊猫烧香核心源码(Delphi) |
· DateDiff函数祥解 · JavaScript去除空格的三种 · js效果 图片加载进度实时.. |
| · SQL Server数据库优化方案 · Oracle的初学者入门心得 · JSP连接Mysql数据库 |
· Photoshop为美女做艺术处理 · 用Freehand创建发光字特效 · 设计自己的个性QQ动态表情 |




