alucard Posted August 24, 2015 Share Posted August 24, 2015 Küçük bir programım var. uzaktaki bir klasörde dosya arıyor ve listboxta listeliyor. program bilgisayarda sorunsuz çalışıyor. kodlarım şunlar: function DosyaListele(KlasorAdi:String;const Liste:TStrings;const Kriter:String='*.*'):Integer; procedure DosyaTara(const Yol:String); var Ara:TSearchRec; st: TSystemTime; lt: TFileTime; dt: TDateTime; begin if FindFirst(Yol+Kriter,faAnyFile,Ara)=0 then repeat if Ara.Attr and faDirectory = 0 then dosyayolu :=StringReplace(Yol+Ara.Name, '\\212.156.84.70\ekg\', '', [rfReplaceAll]); Liste.Add(dosyayolu); until FindNext(Ara)<>0; FindClose(Ara); if FindFirst(Yol+'*.*',faDirectory,Ara)=0 then repeat //daha alt klasörleri tara if (Ara.Name<>'.') and (Ara.Name<>'..') and (Ara.Attr and faDirectory = faDirectory) then DosyaTara(Yol+Ara.Name+'\'); until FindNext(Ara)<>0; FindClose(Ara); end; begin Liste.Clear; if (KlasorAdi<>'') and (KlasorAdi[Length(KlasorAdi)]<>'\') then KlasorAdi:=KlasorAdi+'\'; DosyaTara(KlasorAdi); Result:=Liste.Count; end; DosyaListele(edit4.Text,ListBox1.Items,edit1.text+'*'+edit2.text+'*'+edit3.text+'*.*'); procedure TEkgDosyaAramaMainF.ListBox1DblClick(Sender: TObject); var dosya : string; begin dosya := edit4.Text+'\'+ ListBox1.Items[ListBox1.ItemIndex]; ShellExecute(Application.Handle, 'open', PChar(dosya), nil, nil, SW_NORMAL); end; bunun aynısını uniforma yazdığımda çalışmıyor. Link to comment Share on other sites More sharing options...
alucard Posted August 24, 2015 Author Share Posted August 24, 2015 dosya yolunu yanlış yazmışım çalışıyor. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now