<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>WebFroster &#187; C#</title>
	<atom:link href="http://www.webfroster.com/category/technical/net-technical/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.webfroster.com</link>
	<description>Anything under the sun</description>
	<lastBuildDate>Sat, 31 Jul 2010 07:27:06 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How To Get List Of Folders?</title>
		<link>http://www.webfroster.com/2009/06/20/how-to-get-list-of-folders/</link>
		<comments>http://www.webfroster.com/2009/06/20/how-to-get-list-of-folders/#comments</comments>
		<pubDate>Sat, 20 Jun 2009 08:52:33 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[VB]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.webfroster.com/?p=81</guid>
		<description><![CDATA[To get a list of all sub directories from one location, you can use GetDirectories method, with code like this:
[ C# ]

string[]  SiteDirectories = 
 System.IO.Directory.GetDirectories(Server.MapPath("~/"));

[ VB.NET ]

Dim SiteDirectories() As  String = _
 System.IO.Directory.GetDirectories(Server.MapPath("~/"))

Server.MapPath(&#8220;~/&#8221;) will simply return root folder of web application. To build more stable application it is recommended to use try-catch [...]]]></description>
			<content:encoded><![CDATA[<p>To get a list of all sub directories from one location, you can use <strong>GetDirectories method</strong>, with code like this:</p>
<p><strong>[ C# ]</strong></p>
<pre>
<span style="color: blue;">string</span><span>[]  SiteDirectories = </span>
<span> System.IO.<span style="color: #2b91af;">Directory</span>.GetDirectories(Server.MapPath(<span style="color: #a31515;">"~/"</span>));</span>
</pre>
<p><strong>[ <a href="http://www.webfroster.com/tag/vb/" class="st_tag internal_tag" rel="tag" title="Posts tagged with VB">VB</a>.NET ]</strong></p>
<pre>
<span style="color: blue;">Dim</span><span> SiteDirectories() <span style="color: blue;">As</span> <span style="color: blue;"> String</span> = _</span>
<span> System.IO.Directory.GetDirectories(Server.MapPath(<span style="color: #a31515;">"~/"</span>))</span>
</pre>
<p>Server.MapPath(&#8220;~/&#8221;) will simply return root folder of <a href="http://www.webfroster.com/tag/web/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Web">web</a> application. To build more stable application it is recommended to use try-catch block or to check before if directory exists in your specific case.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webfroster.com/2009/06/20/how-to-get-list-of-folders/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
