Click here to Skip to main content
15,888,461 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# Vb6.0 Com Interop Pin
Thomas Krojer1-Feb-10 1:29
Thomas Krojer1-Feb-10 1:29 
GeneralRe: C# Vb6.0 Com Interop Pin
Richard MacCutchan1-Feb-10 2:00
mveRichard MacCutchan1-Feb-10 2:00 
GeneralRe: C# Vb6.0 Com Interop Pin
Thomas Krojer1-Feb-10 6:25
Thomas Krojer1-Feb-10 6:25 
GeneralRe: C# Vb6.0 Com Interop Pin
Richard MacCutchan1-Feb-10 6:34
mveRichard MacCutchan1-Feb-10 6:34 
GeneralRe: C# Vb6.0 Com Interop Pin
Thomas Krojer1-Feb-10 20:40
Thomas Krojer1-Feb-10 20:40 
GeneralRe: C# Vb6.0 Com Interop Pin
Richard MacCutchan1-Feb-10 23:22
mveRichard MacCutchan1-Feb-10 23:22 
QuestionTreeView Nodes do not update Pin
googoojkhan31-Jan-10 19:38
googoojkhan31-Jan-10 19:38 
AnswerRe: TreeView Nodes do not update Pin
googoojkhan31-Jan-10 21:14
googoojkhan31-Jan-10 21:14 
AnswerRe: TreeView Nodes do not update Pin
Alex Manolescu31-Jan-10 21:28
Alex Manolescu31-Jan-10 21:28 
GeneralRe: TreeView Nodes do not update Pin
Covean31-Jan-10 23:09
Covean31-Jan-10 23:09 
GeneralRe: TreeView Nodes do not update Pin
Alex Manolescu31-Jan-10 23:57
Alex Manolescu31-Jan-10 23:57 
QuestionDisplaying Two Crystal Reports using Single CrystalReportViewer. Pin
Sanket.Patil31-Jan-10 19:04
Sanket.Patil31-Jan-10 19:04 
AnswerRe: Displaying Two Crystal Reports using Single CrystalReportViewer. Pin
basu.sit29-Mar-10 18:51
basu.sit29-Mar-10 18:51 
QuestionAxFramerControl for powerpoint preview Pin
jafaralik31-Jan-10 18:46
jafaralik31-Jan-10 18:46 
QuestionLooping through a CSV with threads Pin
Danpeking31-Jan-10 15:50
Danpeking31-Jan-10 15:50 
AnswerRe: Looping through a CSV with threads Pin
PIEBALDconsult31-Jan-10 15:57
mvePIEBALDconsult31-Jan-10 15:57 
AnswerRe: Looping through a CSV with threads Pin
Luc Pattyn31-Jan-10 16:26
sitebuilderLuc Pattyn31-Jan-10 16:26 
GeneralRe: Looping through a CSV with threads Pin
PIEBALDconsult31-Jan-10 17:05
mvePIEBALDconsult31-Jan-10 17:05 
GeneralRe: Looping through a CSV with threads Pin
Luc Pattyn31-Jan-10 17:19
sitebuilderLuc Pattyn31-Jan-10 17:19 
GeneralRe: Looping through a CSV with threads Pin
Danpeking31-Jan-10 23:00
Danpeking31-Jan-10 23:00 
GeneralRe: Looping through a CSV with threads Pin
Luc Pattyn1-Feb-10 1:40
sitebuilderLuc Pattyn1-Feb-10 1:40 
AnswerRe: Looping through a CSV with threads Pin
#realJSOP31-Jan-10 23:51
mve#realJSOP31-Jan-10 23:51 
AnswerRe: Looping through a CSV with threads Pin
Dan Mos1-Feb-10 5:37
Dan Mos1-Feb-10 5:37 
AnswerRe: Looping through a CSV with threads Pin
Danpeking3-Feb-10 1:08
Danpeking3-Feb-10 1:08 
Thank you very much for the replies.
I created 10 threads and broke down my file into 10 files. Each thread would loop through then.
This is what I went with in the end:

private void btnRun_Click(object sender, EventArgs e)
{
for (int i = 0; i < threadCount; i++)
{
CreateThread(i);
}
}

private void CreateThread(int threadID)
{
Thread thread = new Thread(new ParameterizedThreadStart(RunProcess));
thread.Start(threadID);
lstThread.Add(thread);
}

private void RunProcess(object threadID)
{
int id = (int)threadID;

for (int i = id; i < threadCount; i += threadCount)
{
ProcessByThread(Convert.ToInt32(threadID));
}
lstThread[id].Abort();
}

private void ProcessByThread(int threadNumber)
{
GetDataFromCsv("Batch" + threadNumber + ".csv", threadNumber);
}
Questionwpf Pin
mehrdad33331-Jan-10 12:52
mehrdad33331-Jan-10 12:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.