Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP.NET (Non-Forum Related)
 Finding the index of where I am
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

laser
Advanced Member

Australia
3859 Posts

Posted - 26 November 2003 :  20:42:50  Show Profile
I have this code in a snippet I'm modifying :


For Each s in Directory.GetFiles(Server.MapPath(IMAGE_DIRECTORY), "*.jpg")    


It works fine, but 's' returns a new filename each time around the loop. Is there some construct to tell me the index ?

I don't care if the index is 0-based or 1-based. I can write the code to do it manually, but is there anything built in to .Net to provide this ?

TIA...

laser
Advanced Member

Australia
3859 Posts

Posted - 26 November 2003 :  21:28:21  Show Profile
MSDN didn't mention anything about an index, so I wrote the code manually
Go to Top of Page

Nathan
Help Moderator

USA
7664 Posts

Posted - 27 November 2003 :  01:22:51  Show Profile  Visit Nathan's Homepage
You have to wite it manually for a foreach loop. Otherwise, use a for loop.

Nathan Bales
CoreBoard | Active Users Download
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.17 seconds. Powered By: Snitz Forums 2000 Version 3.4.07