PC Review


Reply
Thread Tools Rate Thread

DirectoryInfo - Multiple file formats

 
 
JANEMAN
Guest
Posts: n/a
 
      24th Feb 2004
Hi guyz.

I am using DirectoryInfo to get the list of files from 1 directory and
then display it in grid. I am using ASP.NET with VB.NET code behind.

But I have to pick 2 different kind of files and leave rest alone. The
following code doesn't seem to be working. Where is the wrong
syntex..?

Code:
dgFileList.DataSource = myDirInfo.GetFiles("*.GIF|*.txt")
dgFileList is a DataGrid from ASP.NET Can some please help me..?

Cheers.
 
Reply With Quote
 
 
 
 
=?Utf-8?B?VHJ5c3Rlcg==?=
Guest
Posts: n/a
 
      24th Feb 2004
The syntax you've used is used for the filter on dialogs, but is not valid for the GetFiles method

In order to achieve your desired results, you will need to call the GetFiles method twice. Something like this

Dim aFiles as New ArrayLis

aFiles.AddRange(myDirInfo.GetFiles("*.txt")
aFiles.AddRange(myDirInfo.GetFiles("*.GIF")
dgFileList.DataSource = aFile

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Exporting GridView data to Multiple File Formats feltra Microsoft ASP .NET 1 19th Jul 2007 12:20 PM
Exporting GridView data to Multiple File Formats - resending feltra Microsoft ASP .NET 0 19th Jul 2007 12:00 PM
DirectoryInfo Getfiles - only for one file jobs Microsoft VB .NET 1 26th Feb 2007 07:20 PM
Open Source C# code for file formats in HTML, Word, lit (unprotected), and other formats? news.austin.rr.com Microsoft Dot NET Compact Framework 3 17th Jan 2005 04:29 AM
possible to get a file size without having to loop through DirectoryInfo? Bob Microsoft VB .NET 1 22nd Nov 2003 08:10 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:19 PM.