When we begin to run a android application, eclipse som […]
3月 222013
When we begin to run a android application, eclipse som […]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, StrUtils; type TForm1 = class(TForm) Edit1: TEdit; Edit2: TEdit; Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; function FindFlatFileInParentDir(curPath, sFile: string): string; function FindFlatFile(curPath, sFile: string): string; implementation {$R *.dfm} function FindFlatFileInParentDir(curPath, sFile: string): string; var pntPath: string; FilePath: string; I: Integer; begin pntPath := curPath; While true do begin FilePath := FindFlatFile(pntPath, sFile); if FilePath <> '' then begin Result := FilePath; Break; end else begin if Length(pntPath) <= 3 then Break; if RightStr(pntPath, 1) = '' then Delete(pntPath, length(pntPath), 1); for I := Length(pntPath) downto 1 do begin if pntPath[I] = '' then begin Delete(pntPath, I, Length(pntPath)); Break; end; end; end; end; end; function FindFlatFile(curPath, sFile: string): string; var sRec: TSearchRec; sRetCode: Integer; sPath: string; begin FillChar(sRec, SizeOf(sRec), #0); sPath := curPath; if RightStr(sPath, 1) <> '' then sPath := sPath + ''; sRetCode := FindFirst(sPath + '*.*', faAnyFile, sRec); While sRetCode = 0 do begin if (sRec.Attr and not faDirectory = 0) and (sRec.Name <> '.') and (sRec.Name <> '..') then Result := FindFlatFile(sPath + sRec.Name, sFile) else begin if AnsiEndsText(sRec.Name, sFile) then begin Result := sPath + sRec.Name ; Break; end else begin end; end; sRetCode := FindNext(sRec); end; end; procedure TForm1.Button1Click(Sender: TObject); begin Caption := FindFlatFileInParentDir(Edit1.Text, Edit2.Text); end; end. |
原来一直在想,既然手机都有了无线网络或者蓝牙技术,为什么调试的时候还需要用数据线来弄,来回插拔麻烦不说,还得一 […]
1. Java中Byte数组与int类型的转换 1) 方法一 [crayon-67d1608b27f75916 […]
设计Android的界面的时候,一直看着列表框中有Custom & Library Views这么一项 […]
我们有时会在开发中,使用按钮的focus选项来实现类似Tab标签页的效果,当用户按下某个按钮后,这个按钮就 […]
注意: 1. 使用WM_SYSCOMMAND时,鼠标的一些消息可能会受到影响,比如不能响应MouseUp事件, […]
在Delphi的ListView中实现向上移动或者向下移动某行的功能,代码如下: [crayon-67d160 […]
使用TabHost的注意事项: 在API13 Android3.2之后Android的SDK中提供了Actio […]
有的时候我们需要为自己的程序提供几种不同的界面风格以供不同的用户根据喜好选择使用,在桌面程序中我们通常是使用x […]