<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://mars.merhot.dk/w/index.php?action=history&amp;feed=atom&amp;title=6236_Programmering_I_Agenda%2FRecursion</id>
		<title>6236 Programmering I Agenda/Recursion - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://mars.merhot.dk/w/index.php?action=history&amp;feed=atom&amp;title=6236_Programmering_I_Agenda%2FRecursion"/>
		<link rel="alternate" type="text/html" href="http://mars.merhot.dk/w/index.php?title=6236_Programmering_I_Agenda/Recursion&amp;action=history"/>
		<updated>2026-04-10T03:08:27Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.29.0</generator>

	<entry>
		<id>http://mars.merhot.dk/w/index.php?title=6236_Programmering_I_Agenda/Recursion&amp;diff=32242&amp;oldid=prev</id>
		<title>Orso at 08:31, 27 November 2015</title>
		<link rel="alternate" type="text/html" href="http://mars.merhot.dk/w/index.php?title=6236_Programmering_I_Agenda/Recursion&amp;diff=32242&amp;oldid=prev"/>
				<updated>2015-11-27T08:31:55Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 08:31, 27 November 2015&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l57&quot; &gt;Line 57:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 57:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;==Opgave==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Lav et program der kan finde en fil med et bestemt navn på din harddisk og udskrive filen.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Hvis du starter fra root vil du opleve problemer med rettigheder til nogle biblioteker, men det kan løses med try catch.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Orso</name></author>	</entry>

	<entry>
		<id>http://mars.merhot.dk/w/index.php?title=6236_Programmering_I_Agenda/Recursion&amp;diff=32241&amp;oldid=prev</id>
		<title>Orso: Created page with &quot;Følgende program kan anvendes til at liste alle filer i et bestemt directory  &lt;source lang=csharp&gt; class Program { 	static void ListFiles(string dir) 	{                 //Opret ...&quot;</title>
		<link rel="alternate" type="text/html" href="http://mars.merhot.dk/w/index.php?title=6236_Programmering_I_Agenda/Recursion&amp;diff=32241&amp;oldid=prev"/>
				<updated>2015-11-27T08:27:43Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;Følgende program kan anvendes til at liste alle filer i et bestemt directory  &amp;lt;source lang=csharp&amp;gt; class Program { 	static void ListFiles(string dir) 	{                 //Opret ...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Følgende program kan anvendes til at liste alle filer i et bestemt directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=csharp&amp;gt;&lt;br /&gt;
class Program&lt;br /&gt;
{&lt;br /&gt;
	static void ListFiles(string dir)&lt;br /&gt;
	{&lt;br /&gt;
                //Opret et array til filnavnene&lt;br /&gt;
		String[] files;&lt;br /&gt;
&lt;br /&gt;
                //Spørg hvilke filer der er i directoriet&lt;br /&gt;
		files = System.IO.Directory.GetFiles(dir);&lt;br /&gt;
&lt;br /&gt;
		//Udskriv alle filerne&lt;br /&gt;
                foreach (string file in files)&lt;br /&gt;
		{&lt;br /&gt;
			System.Console.WriteLine(file);&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	static void Main(string[] args)&lt;br /&gt;
	{&lt;br /&gt;
                //Kald metoden&lt;br /&gt;
		ListFiles(&amp;quot;C:\\&amp;quot;);&lt;br /&gt;
		System.Console.ReadKey();&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ved at ændre i metoden ListFiles kan vi få den til også at liste subdirectories, men rekursivt bliver det når vi lader metoden ListFiles kalde sig selv for hvert subdir.&lt;br /&gt;
&amp;lt;source lang=csharp&amp;gt;&lt;br /&gt;
static void ListFiles(string dir)&lt;br /&gt;
{&lt;br /&gt;
	//Opret et array til filnavnene&lt;br /&gt;
	String[] files;&lt;br /&gt;
&lt;br /&gt;
	//Spørg hvilke filer der er i directoriet&lt;br /&gt;
	files = System.IO.Directory.GetFiles(dir);&lt;br /&gt;
&lt;br /&gt;
	//Udskriv alle filerne&lt;br /&gt;
	foreach (string file in files)&lt;br /&gt;
	{&lt;br /&gt;
		System.Console.WriteLine(file);           &lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	//Lav et array til directory names&lt;br /&gt;
	String[] subdirs;&lt;br /&gt;
	subdirs = System.IO.Directory.GetDirectories(dir);&lt;br /&gt;
	&lt;br /&gt;
	//Loop gennem alle directories&lt;br /&gt;
	foreach (string subdir in subdirs)&lt;br /&gt;
	{&lt;br /&gt;
		//Metoden kalder sig selv med det nye sub&lt;br /&gt;
		ListFiles(subdir);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Orso</name></author>	</entry>

	</feed>