<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Extending the Directory.GetFiles() Filter Pattern</title>
	<atom:link href="http://www.andreas-kraus.net/blog/extending-the-directorygetfiles-filter-pattern/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.andreas-kraus.net/blog/extending-the-directorygetfiles-filter-pattern/</link>
	<description>News, Tutorials and Codesnippets about C#, ASP.NET- Silverlight</description>
	<lastBuildDate>Tue, 05 Jul 2011 10:02:53 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: Upender</title>
		<link>http://www.andreas-kraus.net/blog/extending-the-directorygetfiles-filter-pattern/comment-page-1/#comment-181333</link>
		<dc:creator>Upender</dc:creator>
		<pubDate>Mon, 22 Feb 2010 08:21:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.andreas-kraus.net/blog/extending-the-directorygetfiles-filter-pattern/#comment-181333</guid>
		<description>string[] files = Directory.GetFiles(path, &quot;*&quot;+urSearchstring+&quot;*&quot;);</description>
		<content:encoded><![CDATA[<p>string[] files = Directory.GetFiles(path, &#8220;*&#8221;+urSearchstring+&#8221;*&#8221;);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fizzbin</title>
		<link>http://www.andreas-kraus.net/blog/extending-the-directorygetfiles-filter-pattern/comment-page-1/#comment-158876</link>
		<dc:creator>fizzbin</dc:creator>
		<pubDate>Mon, 30 Mar 2009 00:03:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.andreas-kraus.net/blog/extending-the-directorygetfiles-filter-pattern/#comment-158876</guid>
		<description>[code]        public string ExtensionFilter {
            get { return string.Join(&quot;;&quot;, _extentionFilters); }
            set { _extentionFilters = value.Split(&#039;;&#039;); }
        }

        private string[] _extentionFilters;[/code]</description>
		<content:encoded><![CDATA[<p>[code]        public string ExtensionFilter {<br />
            get { return string.Join(";", _extentionFilters); }<br />
            set { _extentionFilters = value.Split(';'); }<br />
        }</p>
<p>        private string[] _extentionFilters;[/code]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: VS</title>
		<link>http://www.andreas-kraus.net/blog/extending-the-directorygetfiles-filter-pattern/comment-page-1/#comment-142072</link>
		<dc:creator>VS</dc:creator>
		<pubDate>Thu, 11 Dec 2008 18:29:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.andreas-kraus.net/blog/extending-the-directorygetfiles-filter-pattern/#comment-142072</guid>
		<description>This is not updating the array list !! Any ideas??</description>
		<content:encoded><![CDATA[<p>This is not updating the array list !! Any ideas??</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://www.andreas-kraus.net/blog/extending-the-directorygetfiles-filter-pattern/comment-page-1/#comment-104192</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Fri, 16 May 2008 09:41:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.andreas-kraus.net/blog/extending-the-directorygetfiles-filter-pattern/#comment-104192</guid>
		<description>This example is exactly what i&#039;m looking for however very new to .NET, would anyone have the full working code -  with it doing the databind bit 

basically the complete start to finish code - i can compare and see where i&#039;ve gone wrong

Thanks</description>
		<content:encoded><![CDATA[<p>This example is exactly what i&#8217;m looking for however very new to .NET, would anyone have the full working code &#8211;  with it doing the databind bit </p>
<p>basically the complete start to finish code &#8211; i can compare and see where i&#8217;ve gone wrong</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: WeldJla</title>
		<link>http://www.andreas-kraus.net/blog/extending-the-directorygetfiles-filter-pattern/comment-page-1/#comment-104179</link>
		<dc:creator>WeldJla</dc:creator>
		<pubDate>Fri, 16 May 2008 08:30:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.andreas-kraus.net/blog/extending-the-directorygetfiles-filter-pattern/#comment-104179</guid>
		<description>this works is good but there something missed.

When you apply two filters like (*.jpg; *.*), you can get the same files many times in the arrayList (in this case all jpg files will appears 2 times: one for *.jpg and one for *.*).

Then we need to add a function like DISTINCT() to make the list just needed.

thx.</description>
		<content:encoded><![CDATA[<p>this works is good but there something missed.</p>
<p>When you apply two filters like (*.jpg; *.*), you can get the same files many times in the arrayList (in this case all jpg files will appears 2 times: one for *.jpg and one for *.*).</p>
<p>Then we need to add a function like DISTINCT() to make the list just needed.</p>
<p>thx.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ac</title>
		<link>http://www.andreas-kraus.net/blog/extending-the-directorygetfiles-filter-pattern/comment-page-1/#comment-92942</link>
		<dc:creator>ac</dc:creator>
		<pubDate>Sat, 05 Apr 2008 00:51:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.andreas-kraus.net/blog/extending-the-directorygetfiles-filter-pattern/#comment-92942</guid>
		<description>Good HowTo! 
Does anyone know of an example of binding it to a datagrid?</description>
		<content:encoded><![CDATA[<p>Good HowTo!<br />
Does anyone know of an example of binding it to a datagrid?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: andreas.kraus</title>
		<link>http://www.andreas-kraus.net/blog/extending-the-directorygetfiles-filter-pattern/comment-page-1/#comment-77050</link>
		<dc:creator>andreas.kraus</dc:creator>
		<pubDate>Fri, 01 Feb 2008 09:19:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.andreas-kraus.net/blog/extending-the-directorygetfiles-filter-pattern/#comment-77050</guid>
		<description>Thanks  Tim!</description>
		<content:encoded><![CDATA[<p>Thanks  Tim!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim Cartwright</title>
		<link>http://www.andreas-kraus.net/blog/extending-the-directorygetfiles-filter-pattern/comment-page-1/#comment-76909</link>
		<dc:creator>Tim Cartwright</dc:creator>
		<pubDate>Thu, 31 Jan 2008 21:04:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.andreas-kraus.net/blog/extending-the-directorygetfiles-filter-pattern/#comment-76909</guid>
		<description>I actually streamlined your code a bit. Here take a look at this: 

&lt;pre&gt;&lt;code&gt;
string folder = Path.GetDirectoryName(Server.MapPath(rotatorImage.ImageUrl));

string[] filters = {&quot;*.jpg&quot;, &quot;*.png&quot; , &quot;*.gif&quot;};
ArrayList images = new ArrayList();


foreach(string filter in filters){
	images.AddRange(Directory.GetFiles(folder, filter));
}
&lt;/code&gt;&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>I actually streamlined your code a bit. Here take a look at this: </p>
<pre><code>
string folder = Path.GetDirectoryName(Server.MapPath(rotatorImage.ImageUrl));

string[] filters = {"*.jpg", "*.png" , "*.gif"};
ArrayList images = new ArrayList();

foreach(string filter in filters){
	images.AddRange(Directory.GetFiles(folder, filter));
}
</code></pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sean Vikoren</title>
		<link>http://www.andreas-kraus.net/blog/extending-the-directorygetfiles-filter-pattern/comment-page-1/#comment-30138</link>
		<dc:creator>Sean Vikoren</dc:creator>
		<pubDate>Fri, 25 May 2007 10:04:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.andreas-kraus.net/blog/extending-the-directorygetfiles-filter-pattern/#comment-30138</guid>
		<description>Thank you for the tip!

This is what I ended up using:
&lt;code&gt;
		public static string [] GetVideoList (string path)
		{
			string filter = &quot;*.mpg;*.gif&quot; ;
			string [] filterSplit = filter.Split (&#039;;&#039;) ;
			int filterCount = filterSplit.Length ;
			string [] fileList = null ;
			string [][] jaggedFileList = new string[filterCount][] ;
			int fileCount = 0 ;
			int jaggedCount ;
			
			if (Directory.Exists (path))
			{
				for (int i = 0; i </description>
		<content:encoded><![CDATA[<p>Thank you for the tip!</p>
<p>This is what I ended up using:<br />
<code><br />
		public static string [] GetVideoList (string path)<br />
		{<br />
			string filter = "*.mpg;*.gif" ;<br />
			string [] filterSplit = filter.Split (';') ;<br />
			int filterCount = filterSplit.Length ;<br />
			string [] fileList = null ;<br />
			string [][] jaggedFileList = new string[filterCount][] ;<br />
			int fileCount = 0 ;<br />
			int jaggedCount ;</p>
<p>			if (Directory.Exists (path))<br />
			{<br />
				for (int i = 0; i</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rufio</title>
		<link>http://www.andreas-kraus.net/blog/extending-the-directorygetfiles-filter-pattern/comment-page-1/#comment-702</link>
		<dc:creator>Rufio</dc:creator>
		<pubDate>Wed, 09 Aug 2006 19:12:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.andreas-kraus.net/blog/extending-the-directorygetfiles-filter-pattern/#comment-702</guid>
		<description>Hey; great help.

I assume we figure out for our own that we should add up all the strFiles to a seperate array, otherwise in the end strFiles will only have the files belonging to the final filter (assuming strFiles be declared before the for loop)? correct? or am I foolishly missing something?</description>
		<content:encoded><![CDATA[<p>Hey; great help.</p>
<p>I assume we figure out for our own that we should add up all the strFiles to a seperate array, otherwise in the end strFiles will only have the files belonging to the final filter (assuming strFiles be declared before the for loop)? correct? or am I foolishly missing something?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

