|
-
Aug 6th, 2005, 08:24 PM
#1
Thread Starter
Member
Someone review my logic
I have a list of names, an example image, and a goal of having each list of names, be a copy of the example image, but renamed to use each name in the list.
My idea is this:
Create an array to take the image names (which are csv), and set a variable for the "example image" file. So when I want the example image to be hello.jpg, I set sampleimage = "c:\hello.jpg"
Then the program will open that image, and save it using each number in the array. So if the array contained 5 wordd [hello1,how,are,you,today], the output will be 5 copies of the hello.jpg file, and would now be hello1.jpg, how.jpg, are.jpg, you.jpg, today.jpg.
-
Aug 6th, 2005, 08:35 PM
#2
Fanatic Member
Re: Someone review my logic
Sure, you can use For Each to go through the array. And if the image is already a file on the disk you can use System.IO.File.Copy(origfilename, duplicatename)
"so just keep in mind that fantasy is not the same as realtiy and make sure u remember that wii sports may be fun but u cant count on it as exercise ok cool bye" - HungarianHuman
-
Aug 7th, 2005, 12:02 AM
#3
Thread Starter
Member
Re: Someone review my logic
Great, so basically for each in array,
System.IO.File.Copy(origfilename, x)
x =+1
Or can I just have "Next" at the end of the loop?
-
Aug 7th, 2005, 04:07 AM
#4
Re: Someone review my logic
 Originally Posted by Merlin2000
Great, so basically for each in array,
System.IO.File.Copy(origfilename, x)
x =+1
Or can I just have "Next" at the end of the loop?
yes, for loops shift the variable for you
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|