我再次提出另一个问题。
我正在使用来自 raize 的 shelllist,并希望在单击事件中添加一些代码以测试所选项目是否有效(文件、文件夹或空白),但我不确定如何正确执行此操作。
这就是我所拥有的。
procedure ZipCheck;
var
Path : string;
i : integer;
s : string;
DecompStream : TMemoryStream;
LExtention : string;
begin
Path := form2.FileList.SelectedItem.PathName;
form2.FNameEdit.Text := Path;
if form2.FileList.SelectedItem.IsValid = true then
begin
LExtention := TPath.GetExtension(form2.filelist.SelectedItem.PathName);
if tpath.GetExtension(LExtention) = '.zip' then
begin
Showmessage(LExtention);
end;
end;
end;
当我单击 shelllist 的空白区域时会发生什么情况,我得到一个异常错误。