X-Received: by 10.129.168.7 with SMTP id f7mr527204ywh.164.1498115243816; Thu, 22 Jun 2017 00:07:23 -0700 (PDT) X-Received: by 10.157.46.21 with SMTP id q21mr29462otb.11.1498115243775; Thu, 22 Jun 2017 00:07:23 -0700 (PDT) Path: csiph.com!feeder.erje.net!2.us.feeder.erje.net!news.glorb.com!v31no22367qtb.0!news-out.google.com!s132ni1509itb.0!nntp.google.com!185no621334itv.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: it.comp.lang.visual-basic Date: Thu, 22 Jun 2017 00:07:23 -0700 (PDT) In-Reply-To: <9cbe72b2-0327-4e9c-8426-690ee4b31f65@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=213.215.169.20; posting-account=yvxj_woAAABxrxq8XihQzP-tWUWpycQc NNTP-Posting-Host: 213.215.169.20 References: <45cdeed6-8d63-4465-a79d-8cfa9e8343e0@googlegroups.com> <9cbe72b2-0327-4e9c-8426-690ee4b31f65@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Ricerca files in una cartella From: Marco75 Injection-Date: Thu, 22 Jun 2017 07:07:23 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: csiph.com it.comp.lang.visual-basic:19073 Il giorno mercoled=C3=AC 21 giugno 2017 17:09:41 UTC+2, Luca D ha scritto: > I metodi che trovi a partire da 'My.xxx' sono spesso scorciatoie a funzio= ni pi=C3=B9 complete del framework .NET, e vale quasi sempre la pena fare r= iferimento direttamente a quelle; in questo caso le classi che trovi in 'Sy= stem.IO' hanno quello che serve: >=20 > Dim di As New System.IO.DirectoryInfo("C:\MiaCartella\") > If di.Exists Then > Dim fi() As System.IO.FileInfo =3D di.GetFiles("*Verde*.jpg") > If fi.Length > 0 Then > frmAlert.Show() > Else >=20 > End If > End If Grazie ad entrambi, funziona sia il codice per cercare i files che quello p= er filtrare la listbox, spero di cavarmela con tutti i dettagli che andr=C3= =B2 a sviluppare. solo una cosa, il codice Dim fi() As System.IO.FileInfo =3D di.GetFiles("*V= erde*.jpg") filtra il Verde, ma se volessi filtrare sia Verde che Bianco e= scludendo Giallo e Blu come faccio? Una cosa del genere? Dim fi() As System.IO.FileInfo =3D di.GetFiles("*Verde*.jpg") or Dim fi() A= s System.IO.FileInfo =3D di.GetFiles("*Bianco*.jpg") Marco