随笔分类 -  Delphi

上一页 1 2 3 4
Delphi 设计模式:《HeadFirst设计模式》Delphi7代码---门面模式之HomeTheater[转]
摘要:1unituSubObject;23interface45type67{TAmplifier与TTuner,TCDPlayer,TDVDPlayer相互依赖。}8{在TTuner等的简单实现时用不到对TAmplifier的引用,}9{但现实生活中就应该让TAmplifier提供服务,所以这里保留了。... 阅读全文
posted @ 2014-11-05 14:21 小光zfg
Delphi 设计模式:《HeadFirst设计模式》Delphi7代码---命令模式之RemoteControlTest[转]
摘要:12{《HeadFirst设计模式》之命令模式}3{本单元中的类为命令的接收者}4{编译工具:Delphi7.0}5{联系方式:guzh-0417@163.com}67unituReceiveObject;89interface1011type12TLight=class(TObject)13pri... 阅读全文
posted @ 2014-11-05 13:32 小光zfg
Delphi 设计模式:《HeadFirst设计模式》Delphi7代码---命令模式之SimpleRemoteWithUndoTest[转]
摘要:命令模式可以很轻松的实现撤销(Undo)功能。命令的接受者:1unituReceiveObject;23interface45type6TLight=class(TObject)7public8procedureOpen;9procedureOff;10end;1112implementation1... 阅读全文
posted @ 2014-11-05 13:29 小光zfg
Delphi 设计模式:《HeadFirst设计模式》Delphi7代码---命令模式之SimpleRemoteControlTest [转]
摘要://命令的接受者unit uReceiveObject;interfacetype TLight = class(TObject) public procedure Open; procedure Off; end; TGarageDoor = class(TObject) public proce... 阅读全文
posted @ 2014-11-05 13:28 小光zfg
Delphi 设计模式:《HeadFirst设计模式》Delphi7代码---状态模式[转]
摘要:{没有应用状态模式的代码}//工程文件program Project1;{$APPTYPE CONSOLE}uses uGumballMachine in 'uGumballMachine.pas';var aGumballMachine: TGumballMachine;begin aGumbal... 阅读全文
posted @ 2014-11-05 13:27 小光zfg
获取硬盘序列号(IDE,SATA,SCSI) [转]
摘要:{获取SCSI硬盘出厂系列号需要系统管理员权限,不支持磁盘阵列这里只取了第0个或第1个硬盘的序列号}functionGetScsiSerialNumber(consti: smallint):string;typeTScsiPassThrough=recordLength: Word;ScsiSta... 阅读全文
posted @ 2014-11-04 14:34 小光zfg
Delphi进制转换(二进制/十进制/十六进制)[转]
摘要:一、完全用API完成:..uses Windows;function IntToStr(I: integer): string;begin Str(I, Result);end;function StrToInt(S: string): integer;beginVal(S, Result, Res... 阅读全文
posted @ 2014-11-04 14:10 小光zfg
用SPCOMM 在 Delphi中实现串口通讯[转]
摘要:用Delphi 实现串口通讯,常用的几种方法为:使用控件如MSCOMM和SPCOMM,使用API函数或者在Delphi 中调用其它串口通讯程序。利用API编写串口通信程序较为复杂,需要掌握大量通信知识,其优点是可实现的功能更强大,应用面更广泛,更适合于编写较为复杂 的低层次通信程序。相比较而言,利用... 阅读全文
posted @ 2014-10-11 13:26 小光zfg

上一页 1 2 3 4