September 4th, 2012, 12:09 PM
I want to Pass the number of elements i want from string array stack
I don't have any special way i'm passing the number of elements I want. I don't really care what each element's string contain. Here is the issue I already created and have the string array with all of the elements created inside it. i just don't know how to create the logic or generate the proper code to either pass the number of element i want out of the number of elements that already exist in this string array. Here is my current code which is incomplete.
dirString is my String Array varible.
I want to pass it my random value to pick the
# of elements that i want. Examply dirString has 1600 elements in it. In my random value variable
I create a random value and i want to pass this value to return this # of elements from the stack of 1600 elements in the string array. I don't care whats in those elements i only care that it returns that number of element from the stack of 1600.
foreach (var FileString in dirString)
int MyRndVal = myRand.Next(min, max);
for (int i = 0; i <= MyRndVal; i++)
string name = Path.GetFileName(FileString);
string dest = Path.Combine(folderPath, name);
wr.myfileNam = name;
wr.count = count++;
Click Here to Expand Forum to Full Width