TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Yusuf Karatoprak
NA
2.5k
1.1m
multi-thread with parameter but how?
Dec 31 2008 3:24 AM
Hi; i want ot learn how can i start threading with parameter?
This is simple methods : (without parameter)
ThreadStart ts1 = new ThreadStart(UpdateAndInsertDbase);
Thread t1 = new Thread(ts1);
t1.Start();
ThreadStart ts1;
This is complex form : (with parameter)
Thread t1 = new Thread(new ThreadStart(new UpdateAndInsertDbase(
new WaitCallback(UpdateAndInsertDbase), NessusID, Split1, Split2, spenglish, spturkish, conn)));
t1.Start();
But this does not work well.
whole codes here
. . . . . .
. . . .
. . .
. .
.
Thread t1 = new Thread(new ThreadStart(new UpdateAndInsertDbase(
new WaitCallback(UpdateAndInsertDbase), NessusID, Split1, Split2, spenglish, spturkish, conn)));
t1.Start();
}
void UpdateAndInsertDbase(string NessusID, string[] Split1, string[] Split2, string spenglish, string spturkish, string conn)
{
progressBar1.Minimum = 1;
progressBar1.Maximum = Split1.Length;
TableFromSQL sql = new TableFromSQL();
for (int i = 0; i < Split1.Length; i++)
{
progressBar1.Value = i + 1;
sql.AddToDbase(spenglish, conn, NessusID, Split1[i]);
System.Threading.Thread.Sleep(500);
Application.DoEvents();
}
for (int i = 0; i < Split2.Length; i++)
{
progressBar1.Minimum = 1;
progressBar1.Value = i + 1;
System.Threading.Thread.Sleep(500);
Application.DoEvents();
sql.AddToDbase(spturkish, conn, NessusID, Split2[i]);
}
sql.UpdateToDbase("sp_UpdateDbaseAll", conOwn);
}
Sortly ; i want to learn multithread with parameter.Help please?
Reply
Answers (
3
)
NEW reporting tool for Silverlight
Is is Possible to build Internet Radio using SilverLight?