Hi
I have a problem with a console app. It will not run methods in sequence but rather runs them all at the same time? I have put some example code below. The problem is it will run the methods below at the same time, without waiting for the frs to finish? If I remove the foreach statement it does not help. I do not have this problem with a windows forms program, only console?
Method("string1");
Method("string2");
Method("string3");
Method("string4");
class Program
{
static void Main(string[] args)
{
Transfer xfer = new Transfer();
xfer.Run();
}
}
public class Transfer
{
public void Run()
{
List<string> myList= new List<string>();
myList.Add("string1");
myList.Add("string2");
myList.Add("string3");
myList.Add("string4");
Method(string i)
{
//code to do whatever
}
foreach(string i in myList)
{
Method(i);
}
}
}