Computer Science Canada Visual C# Question: Display Folder Contents On Form |
Author: | rar [ Wed Jun 30, 2010 9:56 am ] |
Post subject: | Visual C# Question: Display Folder Contents On Form |
So evolving from my last question, I have another question about folder display. How can I get the folder contents to display on the screen? I'm not sure which tool to use for this, but I'm sure I have to use the path name somehow... |
Author: | Zren [ Wed Jun 30, 2010 6:36 pm ] | ||
Post subject: | Re: Visual C# Question: Display Folder Contents On Form | ||
What do you mean by contents? Like in the folderDialog? Or just a list of files with their paths in a list? For the latter, Use Directory.
Bear in mind, I'm also new to C# so there's could be other/better ways. |
Author: | rar [ Wed Jun 30, 2010 7:53 pm ] | ||
Post subject: | RE:Visual C# Question: Display Folder Contents On Form | ||
Why am I running out of the array??? I don't know of any other way to print on different Lines in the textbox... |
Author: | Zren [ Wed Jun 30, 2010 9:33 pm ] |
Post subject: | RE:Visual C# Question: Display Folder Contents On Form |
Both are string[]. I'll save ya some brainwaves. textBox1.Lines = dirEntries; As for your logic, I'm guessing it's because you didn't initialize textBox1.Lines' size meening it's still the length it was from the begining (empty) so there's your out of bounds error. textBox1.Lines = new string[dirEntries.Length]; |