Tthreadwork = class(Tthread) private Fusername:string;
Fuserpsw:string;在同一个单元内的其他类中,这样向线程中传参数 for i := 0 to Flist.Count - 1do
begin
//Tthreadwork(Flist.Items).Suspend ;
//增加挂起 Tthreadwork(Flist.Items).SetThreadNewUser(myuser,mypass);
//Tthreadwork(Flist.Items).Resume ;
//增加唤醒 end;
function Tthreadwork.SetThreadNewUser(myuser, mypass:string):boolean;
begin
self.Fusername := myuser;
self.Fuserpsw := mypass;
end;
这个挂起和唤醒,是必须的吗?