fish:*号开头的是改写过的,没试过,希望正确吧
var
sr:TsearchRec;
fileattrs:integer;
begin
//先按照图片来做
edit1.text:=extractfilepath(paramstr(0));
fileattrs:=0;
fileattrs:=fileattrs+faanyfile;
if videosup_rb.Checked then
begin
edit4.text:='/webshop/videos/'+shopname;
edit3.Text:=extractfilepath(paramstr(0))+'/videoes';
* edit3.text:=extractfilepath(applicaiton.exename)+'/videoes';
try
begin
if findfirst(edit3.text,fileattrs,sr)=0 then //判断如果有文件
* if findfirst(edit3.text+'/*.mov',fileattrs,sr)=0 then
//----->问题出在这里,居然判断没文件,下面的就全部不执行了
begin
* :upload
NMftp1.Upload(edit3.text+'/'+sr.name,edit4.Text+'/'+sr.Name);
* Nmftp1.upload(edit3.text+'/'+sr.name,edit4.Text+'/'+sr.Name);
while findnext(sr)=0 do //如果不到最后一个
if (sr.attr and fileattrs)=sr.attr then
goto upload;
findclose(sr);winexec(Pchar('deltree -y '+edit3.Text),sw_hide);
if not DirectoryExists(edit3.text) then
if not CreateDir('edit3.text') then // 必须use filectrl,因为是在filectrl里定义的
raise Exception.Create('警告:未能成功创建videoes目录'); end;
end;//end of if
except end;