![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Hobbyist Programmer
|
trying to write a file manager
im trying to write a file manager. its got this:
string[] directories = new string[10000]; directories = System.IO.Directory.GetFiles(path); for (int i = 0; i <= directories.Length; i++) ListView1.Items.Add(directories[i]); and when i run it, it doesnt populate the list view like it should be doing on the last line. any idea why? thanks.
__________________
Children in the dark cause accidents, and accidents in the dark cause children. http://www.ronincoders.org |
|
|
|
|
|
#2 |
|
Expert Programmer
|
Try this:
String[] directories = System.IO.Directory.GetFiles(path); for (int i = 0; i < directories.length; i++) ListView1.Items.add(directories[i]); ListView1.repaint(); |
|
|
|
|
|
#3 |
|
Caffeinated Neural Net
![]() Join Date: Jun 2005
Location: Dry west coast of Canada
Posts: 1,031
Rep Power: 5
![]() |
This looks more like C#. What's it got to do with VB.NET?
__________________
And once again, Probability proves itself willing to sneak into a back alley and service Drama as would a copper-piece harlot. - Vaarsuvius, Order of the Stick |
|
|
|
|
|
#4 |
|
Hobbyist Programmer
|
the repaint() method doesn't exist.
and i know the path is correct because ive done things like written directories[] to a file and finding all of the folderes in there. edit: oh god, im stupid. sorry about that. i wasnt using my brain on that one. of course its c#, im used to posting .net stuff in the vb.net forum. my apologies.
__________________
Children in the dark cause accidents, and accidents in the dark cause children. http://www.ronincoders.org |
|
|
|
|
|
#5 |
|
Caffeinated Neural Net
![]() Join Date: Jun 2005
Location: Dry west coast of Canada
Posts: 1,031
Rep Power: 5
![]() |
You might also want to consider a dynamically-sized container of some sort, rather than an array. Fixed-sized allocations aren't the best structure for this sort of thing. I'm not sure, but it's quite possible there's already a .NET class designed for storing directory trees; there's also things like the TreeView control which you can populate with the results, depending on how you want to display things. Personally, I like having a hierarchical view in file managers; it's why I replaced the stock one on my PocketPC with a third-party one.
__________________
And once again, Probability proves itself willing to sneak into a back alley and service Drama as would a copper-piece harlot. - Vaarsuvius, Order of the Stick |
|
|
|
|
|
#6 |
|
Man Bear Pig Hunter
Join Date: Jul 2005
Location: NorCal, USA
Posts: 295
Rep Power: 4
![]() |
"The box said "Install Windows XP or better" so I installed Linux." - Intimidat0r's Signature
Why are you doing C# if you clearly are a Windows Basher? Why not do C or C++? Answer me that?!!?!?! /rant off |
|
|
|
|
|
#7 |
|
Expert Programmer
|
Many Linux users use C# with Mono.
Why not use it?
__________________
Join us at #programmingforums @ irc.freenode.net! My software never has bugs. It just develops random features.
|
|
|
|
|
|
#8 |
|
Man Bear Pig Hunter
Join Date: Jul 2005
Location: NorCal, USA
Posts: 295
Rep Power: 4
![]() |
coldDeath, thank you for improving my edumacation of linux, I didn't know that was around. So everyone, please forgive me for my last comment, thank you.
|
|
|
|
|
|
#9 | |
|
Hobbyist Programmer
Join Date: Oct 2005
Posts: 211
Rep Power: 3
![]() |
Quote:
However, the industry has a lot of demand for .NET and windows programming right now, and in a lot of places, it's quicker and easier for them to understand and support windows programs, additionally a lot of places 'percieve' that windows is better, and sometimes perception is greater than reality. Just because you dislike something doesn't mean you cut it out entirely, you use what you need to to get the job done, and please those involved. -MBirchmeier |
|
|
|
|
|
|
#10 |
|
Hobbyist Programmer
|
i agree, i simply found the quote funny.
lectricpharaoh, ill try using TreeView and also ill look into that class for directory trees. edit: hmm, still not working... edit2: never mind i made a mistake. that works, thanks lectricpharaoh and everyone else.
__________________
Children in the dark cause accidents, and accidents in the dark cause children. http://www.ronincoders.org Last edited by Intimidat0r; Dec 8th, 2005 at 9:15 PM. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|