i just relized i had that commented out (sorry notepad has no colors) but im
sure this code worked if you can follow
private void mailit()
{
smtp mail = new smtp();
mail.to = txtTo.Text;
mail.from = txtFrom.Text;
mail.name = txtName.Text;
mail.subj = txtSub.Text;
mail.body = txtBody.Text;
mail.label9 = label9;
//mail.pool = listBox2;
mail.srv = ssrv;
mail.inx = ind.ToString();
mail.listBox1 = listBox1;
mail.amount = (Convert.ToInt3 2(txtAmt.Text)/threads);
if (ind != threads)
{
ind++;
if (started == 0)
{
ThreadStart startz = new ThreadStart(mai lit);
worker[ind] = new Thread(startz);
}
worker[ind].Start();
if (ind == (threads-1))
{
}
}
mail.Mail();
}
private void button1_Click(o bject sender, System.EventArg s e)
{
//to do
//amount sent fix
//add waitOne to the socket class not in the mail class, use timeout
paramater etc
//make this project for exfilter command line
string server;
threads = Convert.ToInt32 (txtThreads.Tex t);
smtp mail2 = new smtp();
if (ind > 0)
{ started=1;
server =
txtTo.Text.Subs tring(txtTo.Tex t.IndexOf("@")+ 1,(txtTo.Text.L ength-txtTo.Text.Inde xOf("@")-1));
ssrv=mail2.MXLo okup(server);
listBox1.Items. Add("00 - Started at "+System.DateTi me.Now);
ind=0;
ind++;
worker[ind].Start();
}
else
{
tp.SetMaxThread s(100,5000);
ThreadStart startz = new ThreadStart(mai lit);
server =
txtTo.Text.Subs tring(txtTo.Tex t.IndexOf("@")+ 1,(txtTo.Text.L ength-txtTo.Text.Inde xOf("@")-1));
ssrv=mail2.MXLo okup(server);
listBox1.Items. Add("00 - Started at "+System.DateTi me.Now);
ind++;
worker[ind] = new Thread(startz);
worker[ind].Start();
}
"Hardy Wang" wrote:
Hi, All
I am wandering in 1.1 version of C#, how can I pass parameters to
thread?
In article http://www.yoda.arachsys.com/csharp/threadstart.html, it
provides a way to pass one parameter. It looks like not possible to pass
more than one.
Anybody has a solution?
--
WWW: http://hardywang.1accesshost.com
ICQ: 3359839
yours Hardy