哈哈哈,各位朋友大家好,在csdn没有改版时我也是专攻csdn的delphi版的,今天荣升“四个三角角儿”,高兴,特此抛分,希望版主不要删,高兴啊,大家共同努力,向着“星星”前进,前进,再前进!!
解决方案 »
- [新手问题]问下pascal中=与:=有什么区别?
- 求一SQL语句:取每个类型的2条随机纪录
- 再问个简单问题,刚学,没办法1
- 关于单据录入,DELPHI系统自带的例子是BDE的,转到ADO方式下面,好象有问题..高手看过来,
- 如何使数据库“联机”???
- delphi建立的动态连接库(*.dll文件)在其他语言中怎么调用(如php中)(在线等)
- 程序实现:有一超链接,程序调用系统的"目标另存为"功能
- 对websnap + mts感兴趣的进来
- 求助,谁知道Tab键在Delphi中的表示形式,如回车是#10,换行是#13等?
- D6的MTS怎么不见了?
- 用Delphi怎样进行录音。
- Office97的特大漏洞!!!!????
Midas进阶-认识Midas
作者:雨中轮 (小小->爱被下载中……)
www.nxit.net and www.nxrs.net 版权所有,末经允许,不得以任何形式转载
认识Midas在csdn上Midas版看到类似这样的贴子,Midas/MTS/CORBA到底是什么关系;
在此,就自己对Midsa的认识说一说,而至于MTS or CORBA,前面我们曾很多的提到过,如果你有兴趣可以看一看前边的贴子;
在说Midas之前,我必须申明它和MTS or CORBA or DCOM or RMI是不同的概念;
Midas是Delphi多层应用系统的核心技术,就如以前的或是现在还是Delphi数据库的核心BDE一样,BDE是delphi的数据库引擎,那么我们也可以将MIDAS理解成Delphi处理多层分布式的一种引擎技术,更确定的说MIDAS是Delphi用于存取后端数据库数据的中介透明引擎,而对于客户来说是完全透明的,客户不知道自己所取数据来自何处,又将提交到何处;而程序员则可以通过Midas使用不同的组件存取不同的后端应用程序服务器;而后端的应用程序服务器可以是COM/DCOM应用程序服务器、MTS中介软件、CORBA应用程序服务器,甚至我们可以理解相当于用BDE连接或存取本地或是远程数据一样,这就是我理解的MIDAS的概念;
理解了它的概念之后,我们就可以对MIDAS进行进一步的认识,delphi所提供的MIDAS随着版本的增长,其功能也在不断的强大,最明显的改进应该是它提供了容错能力和负载平衡以及高效率等功能;前边说了,MIDAS是一种透明的中介引擎,主要又应用提现在那几个方面?可以从三个方面来分析,也就是说它主要提供了三个主要的中介者:
NO.1:无程数据中介者(Remote Data Broker):它主要提供客户端存取远程数据库的能力;
NO.2:Constraint:(可以理解为安全性检查),通过它,应用程序下载远程数据库对于数据设定的各种限制,这样,客户端可以在本地对所做操作进行检查,无须再上传到远程数据中或是应用服务器那儿进行检查,这显然可以增加网络负荷;
NO.3:企业对像中介者(Business Object Broker):允许应用系统开发执行企业逻辑的企业对像,并且提供容错和负载平衡能力;
而Midas的状态也可以说是它最大的变动和最成功的地方,Midas提倡无状态,由此才有Object Pooling/Data Pooling /Connect Pooling /以及和MTS的更好结合(以后我会提到相关的)/容错/负载平衡/数据无关等等
Midas的通讯协议同样也包含了三种:TCP/IP,DCOM ,OLE EnterPrise(每种协议都要用到TCP/IP Socket and MS RPC////这就是常见的PRC不可用错误的出现原因,前边有如何解决这种问题的贴子,请参照 );
因此,我们可以将MIDAS与DCOM/COM or MTS or CORBA or RMI完全的区分开来;
一种是中介引擎,而另一种是可以充当中介软件的技术;
在Delphi中,无论是用那一种结构进行连接,或是使用好一种技术。MIDAS都将它们统一起来,比如接口通一(区别是有,但是它能够给一个统一的定义说明就会让我们理解起来方便了很多)比如它提供了统一执着口 Provider(Delphi5有用,而之前的如MIDAS2.0 or MIDAS1.0就用它来进行存取数据,现在已经将其封装到TClientDataSet中);所有这一切都是MIDAS所提供的,而对于使用DCOM or MTS or CORBA (现在还不曾有听说支持RMI,但相信以后会支持的)却是我们不用关心的,这儿的差别只是我们利用那种机制才可以更好的于MIDAS更好的结合;
MIDAS所提供的中介、功能等都是在完全理解了什么是MIDAS的基础上才可以正确的应用的;所以不在本贴所讨论的范围,但小小会尽量抽出时间来将MIDAS的重要功能以及MIDAS的应用整理后放到坛子上和大定一起交流的;
一事相求,要去看女朋友了,带什么好?是网上认识的,而且要去她家,是河北的,河北的那位朋友可否给指点一二?嘻嘻,小小谢谢,朋友们啊,帮帮小小
实现Delphi面版组功能
作者:雨中轮 (小小->爱被下载中……)
www.nxit.net and www.nxrs.net 版权所有,末经允许,不得以任何形式转载不知道各位是否有过被多个快键面版所烦扰,最近遇到了,只好硬着头皮往上顶,作了一个类似与delphi控件面版的东东;
再此与大家一起交流procedure TMainFrm.SpeedButton1Click(Sender: TObject);
var
I , J , K , L: Integer; //用来作循环;
SSpvalue , ESpvalue : TSpeedButton;//中间变量;
SLeft , ELeft ,BLeft: Integer;//Left中间变量;
STagvalue : Integer;//保存当前操作控件Tag;
SBvalue , Bvalue : Boolean;//操作是否完成?
begin
Bvalue := False;
SSpvalue := TSpeedButton.Create(Self);
ESpvalue := TSpeedButton.Create(Self);
STagvalue := ETag;
SBvalue := True;
while SBvalue do
begin
for I := 0 to PageControl1.Pages[0].ControlCount - 1 do
begin
if PageControl1.Pages[0].Controls[I] Is TSpeedButton then
begin
if TSpeedButton(PageControl1.Pages[0].Controls[I]).Left = 563 then
ESpvalue := TSpeedButton(PageControl1.Pages[0].Controls[I]);
end;
end;
for I := 0 to PageControl1.Pages[0].ControlCount - 1 do
begin
if PageControl1.Pages[0].Controls[I] Is TSpeedButton then
begin
if TSpeedButton(PageControl1.Pages[0].Controls[I]).Tag = STagvalue then
begin
SSpvalue := TSpeedButton(PageControl1.Pages[0].Controls[I]);
SSpvalue.Name := ’Spvalue’ + IntToStr(TSpeedButton(PageControl1.Pages[0].Controls[I]).Tag);
SLeft := TSpeedButton(PageControl1.Pages[0].Controls[I]).Left;
STag := TSpeedButton(PageControl1.Pages[0].Controls[I]).Tag;
STagvalue := STag - 1;
for J := 0 to PageControl1.Pages[0].ControlCount - 1 do
begin
if Not Bvalue then
if PageControl1.Pages[0].Controls[J] Is TSpeedButton then
begin
if TSpeedButton(PageControl1.Pages[0].Controls[J]).Tag = STagvalue then
begin
SSpvalue := TSpeedButton(PageControl1.Pages[0].Controls[J]);
STagvalue := TSpeedButton(PageControl1.Pages[0].Controls[J]).Tag;
ELeft := TSpeedButton(PageControl1.Pages[0].Controls[J]).Left;
TSpeedButton(PageControl1.Pages[0].Controls[J]).Left := SLeft;
SSpvalue := TSpeedButton(PageControl1.Pages[0].Controls[J]);
SSpvalue.Visible := True;
Bvalue := True;
for L := 0 to MTag - 2 do
begin
for K := 0 to PageControl1.Pages[0].ControlCount - 1 do
begin
if PageControl1.Pages[0].Controls[K] Is TSpeedButton then
begin
if TSpeedButton(PageControl1.Pages[0].Controls[K]).Tag = STagvalue - 1 then
begin
BLeft := TSpeedButton(PageControl1.Pages[0].Controls[K]).Left;
TSpeedButton(PageControl1.Pages[0].Controls[K]).Left := ELeft;
ELeft := BLeft;
SSpvalue := TSpeedButton(PageControl1.Pages[0].Controls[K]);
STagvalue := TSpeedButton(PageControl1.Pages[0].Controls[K]).Tag;
SSpvalue.Visible := True;
end;
end;
end;
end;
SBvalue := False;
end;
end;
end;
end;
end;
end;
for K := 0 to PageControl1.Pages[0].ControlCount - 1 do
begin
if PageControl1.Pages[0].Controls[K] Is TSpeedButton then
begin
if TSpeedButton(PageControl1.Pages[0].Controls[K]).Left = 563 then
begin
if TSpeedButton(PageControl1.Pages[0].Controls[K]).Tag = MTag then
SBvalue := False;
end;
end;
end;
end;
ESpvalue.Left := 0 ;
ESpvalue.Visible := False;
TVSOne;
for I := 0 to PageControl1.Pages[0].ControlCount - 1 do
begin
if PageControl1.Pages[0].Controls[I] Is TSpeedButton then
begin
if TSpeedButton(PageControl1.Pages[0].Controls[I]).Left = 58 then
begin
if TSpeedButton(PageControl1.Pages[0].Controls[I]).Tag <> 1 then
SpeedButton1.Enabled := True
else
SpeedButton1.Enabled := False;
STag := TSpeedButton(PageControl1.Pages[0].Controls[I]).Tag;
end
end;
end;
VShow;
end;
作者:雨中轮 (小小->爱被下载中……)
www.nxit.net and www.nxrs.net 版权所有,末经允许,不得以任何形式转载
procedure TMainFrm.TVSOne;
var
I : Integer;
begin
for I := 0 to PageControl1.Pages[0].ControlCount - 1 do
begin
if PageControl1.Pages[0].Controls[I] Is TSpeedButton then
begin
if TSpeedButton(PageControl1.Pages[0].Controls[I]).Left = 58 then
begin
if TSpeedButton(PageControl1.Pages[0].Controls[I]).Tag <> 1 then
SpeedButton1.Enabled := True;
STag := TSpeedButton(PageControl1.Pages[0].Controls[I]).Tag;
end;
end;
end;
for I := 0 to PageControl1.Pages[0].ControlCount - 1 do
begin
if PageControl1.Pages[0].Controls[I] Is TSpeedButton then
begin
if TSpeedButton(PageControl1.Pages[0].Controls[I]).Left = 563 then
begin
if TSpeedButton(PageControl1.Pages[0].Controls[I]).Tag <> MTag then
SpeedButton15.Enabled := True;
ETag := TSpeedButton(PageControl1.Pages[0].Controls[I]).Tag;
Exit;
end else
SpeedButton15.Enabled := False;
end;
end;
end;楼上的,你等一下
作者:雨中轮 (小小->爱被下载中……)
www.nxit.net and www.nxrs.net 版权所有,末经允许,不得以任何形式转载
procedure TMainFrm.VShow;
var
I : Integer;
begin
for I := 0 to PageControl1.Pages[0].ControlCount - 1 do
if PageControl1.Pages[0].Controls[I] Is TSpeedButton then
if TSpeedButton(PageControl1.Pages[0].Controls[I]).Left = 0 then
TSpeedButton(PageControl1.Pages[0].Controls[I]).Visible := False;
end;procedure TMainFrm.FormShow(Sender: TObject);
var
I : Integer;
begin
StatusBar1.Panels[0].Text := ’操作员:’ + DataModuleFrm.UserName;
StatusBar1.Panels[3].Text := ’登录时间:’ + DataModuleFrm.LognTime;
if DataModuleFrm.Userqx <> ’001’ then
begin
SpeedButton45.Visible := False;
SpeedButton46.Visible := False;
SpeedButton47.Left := 58;
end;
for I := 0 to PageControl1.Pages[0].ControlCount - 1 do
begin
if PageControl1.Pages[0].Controls[I] Is TSpeedButton then
begin
TSpeedButton(PageControl1.Pages[0].Controls[I]).Top := 2;
if (TSpeedButton(PageControl1.Pages[0].Controls[I]).Tag < 1) or (TSpeedButton(PageControl1.Pages[0].Controls[I]).Tag > 14) then
begin
if TSpeedButton(PageControl1.Pages[0].Controls[I]).Tag <> 200 then
begin
TSpeedButton(PageControl1.Pages[0].Controls[I]).Left := 0;
TSpeedButton(PageControl1.Pages[0].Controls[I]).Visible := False;
end;
end;
if TSpeedButton(PageControl1.Pages[0].Controls[I]).Left = 58 then
begin
if TSpeedButton(PageControl1.Pages[0].Controls[I]).Tag > 1 then
SpeedButton1.Enabled := True;
STag := TSpeedButton(PageControl1.Pages[0].Controls[I]).Tag;
end;
end;
end;
for I := 0 to PageControl1.Pages[0].ControlCount - 1 do
begin
if PageControl1.Pages[0].Controls[I] Is TSpeedButton then
begin
if TSpeedButton(PageControl1.Pages[0].Controls[I]).Left = 563 then
begin
if TSpeedButton(PageControl1.Pages[0].Controls[I]).Tag <> MTag then
SpeedButton15.Enabled := True;
ETag := TSpeedButton(PageControl1.Pages[0].Controls[I]).Tag;
end;
end;
end;
end;
Form1: TForm1;
i:integer;
function SubClassWndProc(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM):LResult;stdcall;function SubClassWndProc(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM):LResult;stdcall;
begin
if Msg = WM_LBUTTONUP then
begin
Showmessage('click me');
Result := 0;
end
else
begin
Result := CallWindowProc(Pointer(i),Form1.Button1.handle,Msg,WParam,LParam);
end;
end;procedure TForm1.Button2Click(Sender: TObject);
begin
i:=GetWindowLong(Button1.Handle,GWL_WNDPROC);
SetWindowLong(Button1.Handle,GWL_WNDPROC,Longint(@SubClassWndProc));
end;procedure TForm1.FormDestroy(Sender: TObject);
begin
SetWindowLong(Handle,GWL_WNDPROC,LongInt(Pointer(i)));
end;
嘻嘻,小小以后改:)谢谢;其实这是个例外,呵呵;真的,那天写代码写到早上五点半,累的没有心情再改了,就用了;TO All
给女朋友带什么啊????
hoho......浪漫点的,送朵花
实际点的,送快dove的巧克力
再实际点的,如果她爱看书,送本书好了
不必太贵,精致就好
那么伯父伯母呢 ?送朵花?送快dove的巧克力?送本书好?
我严重同意楼主:提高结贴率!
嘻嘻,小虫啊,小小也好久没有来了,你就两星啦,再过几天不来,你不就三、四、五星,小小流口水中……
谢谢,可是,有一点是,我们是网上认识的,我离她很远,而且,这是第一次,她也说了,什么也不用带了,要带的话,那两个土豆就中,可是毕境是第一次上门,不能太没有礼貌的啊;可是带点什么东西呢?本来就是第一次啊
谢谢,嘻嘻,小虫~~亲一口 ,啵~
作者:雨中轮 (小小->爱被下载中……)
www.nxit.net/bbs and www.nxrs.net/bbs 版权所有,末经允许,不得以任何形式转载
procedure TPublicClass.KJAddData(KJvalue: String; COm: TComponent;Sender:TObject;Key:Char);
var
I , J : Integer;
Tagvalue : Integer;
begin
if Not( Key in ['.','0'..'9',#13,#8,#46]) then
Key := #0;
if Key = #13 then
begin
Tagvalue := TEdit(Sender).Tag;
end;
for I := 0 to TScrollBox(Com.FindComponent(KJvalue)).ControlCount - 1 do
begin
if TScrollBox(Com.FindComponent(KJvalue)).Controls[I] IS TEdit then
begin
if TEdit(TScrollBox(Com.FindComponent(KJvalue)).Controls[I]).Tag = Tagvalue + 1 then
begin
TEdit(TScrollBox(Com.FindComponent(KJvalue)).Controls[I]).SetFocus;
Exit;
end;
end;
end;
end;
作者:雨中轮 (小小->爱被下载中……)
www.nxit.net/bbs and www.nxrs.net/bbs 版权所有,末经允许,不得以任何形式转载
function TPublicClass.DataComboBox(Tablevalue,
Fieldvalue: String): TStrings;
var
RS : TStrings;
begin
RS := TStringList.Create;
Result := RS;
RS.Clear;
Try
DataModuleFrm.JzclsyADOConnection.GetTableNames(RS,False);
//DataModuleFrm.JzclsyADOConnection.GetProcedureNames(RS);
{}
Except
Application.MessageBox('对不起,数据表提取错误,请重新再试','操作提示',MB_OK + MB_ICONINFORMATION);
Exit;
end;
if RS.IndexOf(Tablevalue) = -1 then
begin
Application.MessageBox('对不起,您所要搜索的数据表不存在','操作提示',MB_OK + MB_ICONINFORMATION);
RS.Free;
Exit;
end;
RS.Clear;
DataModuleFrm.JzclsyADOConnection.GetFieldNames(Tablevalue,RS);
if RS.IndexOf(Fieldvalue) = -1 then
begin
Application.MessageBox('对不起,您所要搜索的数据表中不存在这个字段','操作提示',MB_OK + MB_ICONINFORMATION);
RS.Free;
Exit;
end;
RS.Clear;
Try
with DataModuleFrm.LSB_ADOQuery do
begin
if Active then
Active := False;
SQL.Clear;
SQL.Add('Select Distinct ' + Fieldvalue + ' from ' + Tablevalue);
Open;
if RecordCount = 0 then
Exit;
First;
end;
while Not DataModuleFrm.LSB_ADOQuery.Eof do
begin
RS.Add(DataModuleFrm.LSB_ADOQuery.FieldByName(Fieldvalue).AsString);
DataModuleFrm.LSB_ADOQuery.Next;
end;
Except
Application.MessageBox('对不起,数据操作错误','操作提示',MB_OK + MB_ICONINFORMATION);
Exit;
end;
Result := RS;
end;示例调用
procedure TgjyclFrm.Shows;
begin
ISOComboBox.Items := PublicClass.DataComboBox('Jzclsy_Isowh','Isowh_rz');
GcmcComboBox.Items := PublicClass.DataComboBox('jzclsy_gcmc','Gcmc_mc');
wtdwComboBox.Items := PublicClass.DataComboBox('Jzclsy_wtdw','wtdw_mc');
qyrComboBox.Items := PublicClass.DataComboBox('Jzclsy_qyrwh','Qyrwh_qyr');
JzrComboBox.Items := PublicClass.DataComboBox('jzclsy_jzrwh','Jzrwh_jzr');
end;
begin
接分;
end; ^_^
begin
接分;
end;
begin
接分;
end;
在 借助ghyghost (我要求delphi能理解我的心情) 兴奋之时 ,我得向某些人一样,排一下马屁,接点分,因为我是delphi的初学者,要向着“星星”前进,前进,再前进。
begin
接分;
end;
www.umlchina.com
www.itpub.net不可不看的地方..呵呵...