Renato Haddad

MVP, Developer .NET and MS-Office, MCPD, MCTS

Lendo arquivos ocultos numa pasta com o LINQ e VB.NET

Veja um código em VB.NET para pesquisar com o LINQ todos os arquivos ocultos numa pasta:

Dim fileList = From f In New DirectoryInfo("C:\").GetFiles() _

Where (f.Attributes And FileAttributes.Hidden) = FileAttributes.Hidden _

Order By f.Name

txtDados.Text = "Arquivos Hidden:" + vbNewLine

For Each f In fileList

txtDados.Text += f.Name + vbNewLine

Next

 

Quem disse que não é possível usar o VB.NET com LINQ? Claro que é, e o melhor de tudo é que é super fácil.

Posted: Jul 28 2009, 12:34 AM by renatohaddad | with no comments
Filed under:

Comments

No Comments

Leave a Comment

(required) 

(required) 

(optional)

(required)