讨论B/S架构的实现。http://www.wecoo.com是如何实现的?用ASP+Delphi5能做出来吗? to zhanggy(阿光):如果你需要,我可以将修正过的金额转换模块发邮件给你 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 To : bestext(bestext) 我想要呀![email protected]谢谢 to :bestext(bestext)我也想要,谢谢!email:[email protected] 我也想看看,谢谢[email protected] to bestext(bestext):请给我一份 [email protected] 谢谢! 我信你说的就是用delphi开发COM+组件,然后通过脚本调用COM+组件的方法达。我现在正在做的项目就使用了这种方法。你可以按以下的步骤做一个简单的例子;到开delphi后新建一个ActivX Library 工程,添加一个Activ Server Object取名test.通过View里的View Library 添加一个方法TestPage。TestPage中添加上你的代码。在程序里就可以调用ASP封装的对象如Response 、Request、Session、Server等。然后在test.asp文件中创建COM对象Project2.test调用TestPage。当然你必须把Test组件安装。代码如下:unit Unit1;//COM文件{$WARN SYMBOL_PLATFORM OFF}interfaceuses ComObj, ActiveX, AspTlb, Project2_TLB, StdVcl;type Ttest = class(TASPObject, Itest) protected procedure OnEndPage; safecall; procedure OnStartPage(const AScriptingContext: IUnknown); safecall; procedure TestPage; safecall; end;implementationuses ComServ;procedure Ttest.OnEndPage;begin inherited OnEndPage;end;procedure Ttest.OnStartPage(const AScriptingContext: IUnknown);begin inherited OnStartPage(AScriptingContext);end;procedure Ttest.TestPage;begin Response.Write('测试Test');end;initialization TAutoObjectFactory.Create(ComServer, Ttest, Class_test, ciMultiInstance, tmApartment);end.library Project2;//工程文件{%File 'test.asp'}uses ComServ, Project2_TLB in 'Project2_TLB.pas', Unit1 in 'Unit1.pas' {test: CoClass};exports DllGetClassObject, DllCanUnloadNow, DllRegisterServer, DllUnregisterServer;{$R *.TLB}{$R *.RES}beginend.下面是Test.asp文件<HTML><BODY><TITLE> Testing Delphi ASP </TITLE><CENTER><H3> You should see the results of your Delphi Active Server method below </H3></CENTER><HR><% Set DelphiASPObj = Server.CreateObject("Project2.test") DelphiASPObj.TestPage%><HR></BODY></HTML> 我想只要你知道了这些基本的,那你只要根据在自己的业务逻辑加入代码就行了。如果要和数据库可连接,那你就加入一个数据模块,然后在你的COM对象中创建这个数据模块就行了 to bestext(bestext)我也非常想要,[email protected]万分感谢! to: bestext(bestext)谢谢,我的“油箱”是[email protected] OCX和DLL有什么区别? ComboBox组件自动弹出问题 请问delphi做同时并发100客户端以上的较大型网络数据库程序如何? 谁有人事工资管理系统的源码 Listbox在什么情况下会报“非法的浮点数操作”的错误? 那里有tCalendar阿?不是 tmonthcalendar...?????? 不规则图形 怎么根据IHTMLWindow2来获得IWebBrowser2? 如何令一个窗体总在最前面?? 从delphi4移植到delphi5要注意什么问题 关于Delphi的迷惑? 有关安装程序的问题!新手在相等!
我想要呀![email protected]谢谢
我也想要,谢谢!email:[email protected]
我现在正在做的项目就使用了这种方法。你可以按以下的步骤做一个简单的例子;
到开delphi后新建一个ActivX Library 工程,添加一个Activ Server Object取名test.
通过View里的View Library 添加一个方法TestPage。TestPage中添加上你的代码。
在程序里就可以调用ASP封装的对象如Response 、Request、Session、Server等。
然后在test.asp文件中创建COM对象Project2.test调用TestPage。当然你必须把Test组件安装。代码如下:unit Unit1;
//COM文件
{$WARN SYMBOL_PLATFORM OFF}interfaceuses
ComObj, ActiveX, AspTlb, Project2_TLB, StdVcl;type
Ttest = class(TASPObject, Itest)
protected
procedure OnEndPage; safecall;
procedure OnStartPage(const AScriptingContext: IUnknown); safecall;
procedure TestPage; safecall;
end;implementationuses ComServ;procedure Ttest.OnEndPage;
begin
inherited OnEndPage;
end;procedure Ttest.OnStartPage(const AScriptingContext: IUnknown);
begin
inherited OnStartPage(AScriptingContext);
end;procedure Ttest.TestPage;
begin
Response.Write('测试Test');
end;initialization
TAutoObjectFactory.Create(ComServer, Ttest, Class_test,
ciMultiInstance, tmApartment);
end.library Project2;
//工程文件
{%File 'test.asp'}uses
ComServ,
Project2_TLB in 'Project2_TLB.pas',
Unit1 in 'Unit1.pas' {test: CoClass};exports
DllGetClassObject,
DllCanUnloadNow,
DllRegisterServer,
DllUnregisterServer;{$R *.TLB}{$R *.RES}begin
end.
下面是Test.asp文件
<HTML>
<BODY>
<TITLE> Testing Delphi ASP </TITLE>
<CENTER>
<H3> You should see the results of your Delphi Active Server method below </H3>
</CENTER>
<HR>
<% Set DelphiASPObj = Server.CreateObject("Project2.test")
DelphiASPObj.TestPage
%>
<HR>
</BODY>
</HTML>
我也非常想要,[email protected]
万分感谢!
谢谢,我的“油箱”是[email protected]