大虾们:
假设我有一个d:\test文件夹
我要判断这个test文件夹里有没有test.txt文件?
代码怎么写?详细点!
假设我有一个d:\test文件夹
我要判断这个test文件夹里有没有test.txt文件?
代码怎么写?详细点!
解决方案 »
- delphi给参数赋值的问题,期待高手
- ★★ 是大虾就请放马过来帮小弟一把! ----关于 adoDataset的SavetoFile和LoadFromFile引起的问题
- 紧急求助!!DBGRID多行选择问题.
- 我MM摔伤了,希望她早日恢复!~~~~散分~~~~(四)
- 我加赏100分
- ActiveForm的问题
- 急急!!1
- ado+access,在access库中添加一个表。
- 哪位达人给点sql server c/s开发源码?我有个问题想不明白。
- 为什么用OpenPictureDialog返回的filename属性是乱码?
- 如何读取一文本文件的第一和第二行
- 一个有30多个参数的存储过程。(在线)
showmessage('found');
例如:
procedure TForm1.Button1Click(Sender: TObject);var
sr: TSearchRec;
FileAttrs: Integer;
begin
StringGrid1.RowCount := 1;
if CheckBox1.Checked then
FileAttrs := faReadOnly
else
FileAttrs := 0;
if CheckBox2.Checked then
FileAttrs := FileAttrs + faHidden;
if CheckBox3.Checked then
FileAttrs := FileAttrs + faSysFile;
if CheckBox4.Checked then
FileAttrs := FileAttrs + faVolumeID;
if CheckBox5.Checked then FileAttrs := FileAttrs + faDirectory;
if CheckBox6.Checked then
FileAttrs := FileAttrs + faArchive;
if CheckBox7.Checked then FileAttrs := FileAttrs + faAnyFile; if FindFirst(Edit1.Text, FileAttrs, sr) = 0 then begin
with StringGrid1 do
begin
if (sr.Attr and FileAttrs) = sr.Attr then
begin
Cells[1,RowCount-1] := sr.Name;
Cells[2,RowCount-1] := IntToStr(sr.Size);
end;
while FindNext(sr) = 0 do
begin
if (sr.Attr and FileAttrs) = sr.Attr then
begin
RowCount := RowCount + 1;
Cells[1, RowCount-1] := sr.Name; Cells[2, RowCount-1] := IntToStr(sr.Size);
end;
end;
FindClose(sr);
end;
end;
end;