Eclipse打包成JAR包读取外部JAR包和外部配置文件(源码)
Eclipse 打包 JAR包 外部配置文件
Eclipse打包成JAR包读取外部JAR包和外部配置文件 Eclipse 打包 jar 外部JAR 外部配置文件
TPerson = class private Name:string; ListBox:TListBox; public constructor Create(AName:string;AListBox:TListBox); overload; constructor Create;overload; procedure Show;virtual; end; TFinery = class(TPerson) protected Component:TPerson; public procedure Decorator(Acomponent:TPerson); procedure Show;override; end; TShirts = class(TFinery) public procedure Show;override; end; TBigTrouser = class(TFinery) public procedure Show;override; end;
type TIProduct = class str:string; function Print():string;virtual; end; type TProduct_A = class(TIProduct) private public function Print():string;override; end; type TProduct_B = class(TIProduct) private public function Print():string;override; end; type TSimpleFactory = class private public function CreateProduct(A:string):TIProduct; end;
unit UnitMain; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Label1: TLabel; Edit1: TEdit; Button1: TButton; Label2: TLabel; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); var buffer:PChar;//存储空间 L:Integer;//密码框内容的长度 begin L:=GetWindowTextLength(Edit1.Handle);//取密码框内容的长度 GetMem(buffer,L+1);//分配内存空间,注意加1,因为ASCII码以"\0"结尾 SendMessage(Edit1.Handle,WM_GETTEXT,L+1,Integer(buffer)); Label2.Caption:=string(buffer);//显示 FreeMem(buffer);//释放内存 end; end.
function RecycleFile(sFileName:string):Boolean; var FOS:TSHFileOpStruct; begin FillChar(FOS,SizeOf(FOS),0);{记录清零} with FOS do begin wFunc:=FO_DELETE; //删除 pFrom:=PChar(sFileName); fFlags:=FOF_ALLOWUNDO; //移入回收站,而不是物理删除 end; Result:=(SHFileOperation(FOS)=0); end;
while SRI = 0 do begin if (SR.Name = '.') or (SR.Name = '..') then begin //不用做 end else if SR.Attr = faDirectory then begin if CheckBox1.Checked then begin Start(APath + '\' + sr.Name, SR.Name, ndRoot); end; end else begin Num := Num + 1; Label2.Caption := IntToStr(Num); ListBox1.Items.Add(SR.Name); nd := TreeView1.Items.AddChild(ndRoot, SR.Name); end; SRI := FindNext(SR); end;
program OnlyOne; uses Forms, Windows, Dialogs, UnitMain in 'UnitMain.pas' {Form1}; resourcestring FMutex = 'MUTEX_ONLY_ONE'; //互斥对象名 {$R *.res} var hMutex:HWND; iRet:Integer; begin