Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Dec 5th, 2005, 8:57 PM   #1
Intimidat0r
Hobbyist Programmer
 
Intimidat0r's Avatar
 
Join Date: May 2005
Location: Don't know, but the padded walls are a nice touch.
Posts: 126
Rep Power: 0 Intimidat0r is an unknown quantity at this point
Send a message via ICQ to Intimidat0r Send a message via AIM to Intimidat0r Send a message via MSN to Intimidat0r Send a message via Yahoo to Intimidat0r
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
Intimidat0r is offline   Reply With Quote
Old Dec 5th, 2005, 10:45 PM   #2
titaniumdecoy
Expert Programmer
 
titaniumdecoy's Avatar
 
Join Date: Nov 2005
Posts: 855
Rep Power: 3 titaniumdecoy is on a distinguished road
Send a message via AIM to titaniumdecoy
Try this:
String[] directories = System.IO.Directory.GetFiles(path);
for (int i = 0; i < directories.length; i++)
  ListView1.Items.add(directories[i]);
ListView1.repaint();
Also check your filepath.
titaniumdecoy is offline   Reply With Quote
Old Dec 5th, 2005, 11:36 PM   #3
lectricpharaoh
Caffeinated Neural Net
 
lectricpharaoh's Avatar
 
Join Date: Jun 2005
Location: Dry west coast of Canada
Posts: 1,031
Rep Power: 5 lectricpharaoh will become famous soon enough
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
lectricpharaoh is offline   Reply With Quote
Old Dec 5th, 2005, 11:39 PM   #4
Intimidat0r
Hobbyist Programmer
 
Intimidat0r's Avatar
 
Join Date: May 2005
Location: Don't know, but the padded walls are a nice touch.
Posts: 126
Rep Power: 0 Intimidat0r is an unknown quantity at this point
Send a message via ICQ to Intimidat0r Send a message via AIM to Intimidat0r Send a message via MSN to Intimidat0r Send a message via Yahoo to Intimidat0r
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
Intimidat0r is offline   Reply With Quote
Old Dec 6th, 2005, 12:03 AM   #5
lectricpharaoh
Caffeinated Neural Net
 
lectricpharaoh's Avatar
 
Join Date: Jun 2005
Location: Dry west coast of Canada
Posts: 1,031
Rep Power: 5 lectricpharaoh will become famous soon enough
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
lectricpharaoh is offline   Reply With Quote
Old Dec 7th, 2005, 6:18 PM   #6
Ghost
Man Bear Pig Hunter
 
Ghost's Avatar
 
Join Date: Jul 2005
Location: NorCal, USA
Posts: 295
Rep Power: 4 Ghost is on a distinguished road
"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
Ghost is offline   Reply With Quote
Old Dec 8th, 2005, 1:28 AM   #7
coldDeath
Expert Programmer
 
coldDeath's Avatar
 
Join Date: Aug 2005
Location: UK
Posts: 862
Rep Power: 4 coldDeath is on a distinguished road
Send a message via AIM to coldDeath Send a message via Yahoo to coldDeath
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.
coldDeath is offline   Reply With Quote
Old Dec 8th, 2005, 9:25 AM   #8
Ghost
Man Bear Pig Hunter
 
Ghost's Avatar
 
Join Date: Jul 2005
Location: NorCal, USA
Posts: 295
Rep Power: 4 Ghost is on a distinguished road
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.
Ghost is offline   Reply With Quote
Old Dec 8th, 2005, 10:39 AM   #9
MBirchmeier
Hobbyist Programmer
 
Join Date: Oct 2005
Posts: 211
Rep Power: 3 MBirchmeier is on a distinguished road
Quote:
Originally Posted by Ghost
"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
I'm much the same way... I'm not much of a windows basher, but I avoid microsoft products pretty much whenever I can, in my personal life and projects.

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
MBirchmeier is offline   Reply With Quote
Old Dec 8th, 2005, 8:55 PM   #10
Intimidat0r
Hobbyist Programmer
 
Intimidat0r's Avatar
 
Join Date: May 2005
Location: Don't know, but the padded walls are a nice touch.
Posts: 126
Rep Power: 0 Intimidat0r is an unknown quantity at this point
Send a message via ICQ to Intimidat0r Send a message via AIM to Intimidat0r Send a message via MSN to Intimidat0r Send a message via Yahoo to Intimidat0r
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.
Intimidat0r is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 2:03 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC