procedure TForm1.RzShellTree1Change(Sender: TObject; Node: TTreeNode);
var
SearchRec : TSearchRec;
Path : String;
Attr : integer;
Found : integer;
begin
Path := RzShellTree1.SelectedPathName+'\*.*';//设定搜索要显示的路径和文件类型
Attr := faAnyFile;
Found := FindFirst(Path, Attr, SearchRec);//查找文件
while Found = 0 do
begin
RzListView_MuiscList.Items.Add; //添加内容
RzListView_MuiscList.Items[RzListView_MuiscList.Items.Count-1].Caption := (SearchRec.Name);
Found := FindNext(SearchRec);
end;
FindClose(SearchRec);//停止查找
//AudioObjectPlayer.OpenFiles(OpenDialog.Files);
end;
上面的方法可以搜索到全部的文件,我想只搜索音频的要怎么搜索呀Attr := ????;
要是用IF判断太麻烦了,要写好长好长一段!
var
SearchRec : TSearchRec;
Path : String;
Attr : integer;
Found : integer;
begin
Path := RzShellTree1.SelectedPathName+'\*.*';//设定搜索要显示的路径和文件类型
Attr := faAnyFile;
Found := FindFirst(Path, Attr, SearchRec);//查找文件
while Found = 0 do
begin
RzListView_MuiscList.Items.Add; //添加内容
RzListView_MuiscList.Items[RzListView_MuiscList.Items.Count-1].Caption := (SearchRec.Name);
Found := FindNext(SearchRec);
end;
FindClose(SearchRec);//停止查找
//AudioObjectPlayer.OpenFiles(OpenDialog.Files);
end;
上面的方法可以搜索到全部的文件,我想只搜索音频的要怎么搜索呀Attr := ????;
要是用IF判断太麻烦了,要写好长好长一段!
Path := RzShellTree1.SelectedPathName+'\*.*'
改成
Path := RzShellTree1.SelectedPathName+'\*.wav'多种文件后缀,就多次修改并调用,把它们结果整合到一起,就可以了