Z
zql1982000
Unregistered / Unconfirmed
GUEST, unregistred user!
我写了一个nt服务 大概的想法就是每隔几分钟检测一西数据库里面有没有新的东西
但是我加了如下一段后在在服务过程中之后启动服务就老说服务魔芋什么可以做 注释掉就可以了,我的服务里面有一个死循环,服务过程是不可能结束的啊,怎么回事
如果我把
i:=0;
while i=0do
begin
ADOSelect.SQL.Clear;//清除上次的数据记录
ADOSelect.SQL.Add('select Id,DesPhone,Content,AddCode From [S_HL_SMSMT] order by ID asc');
ADOSelect.Open;
While not ADOSelect.Eofdo
begin
ThreadIntro[ThreadFreeListNUm][2]:=ADOSelect.Recordset.Fields[0].Value;
ThreadIntro[ThreadFreeListNUm][3]:=ADOSelect.Recordset.Fields[1].Value;
ThreadIntro[ThreadFreeListNUm][4]:=ADOSelect.Recordset.Fields[2].Value;
ThreadIntro[ThreadFreeListNUm][5]:=ADOSelect.Recordset.Fields[3].Value;
TSendSmsThread.Create(ThreadFreeList[ThreadFreeListNUm]);
ThreadFreeListNUm:=ThreadFreeListNUm-1;//采用数组倒置的赋值
end;
ADOSelect.Close;
Sleep(20000);
ServiceThread.ProcessRequests(False);
end
如果我把这段注释掉就好了
ADOSelect.Open;
While not ADOSelect.Eofdo
begin
ThreadIntro[ThreadFreeListNUm][2]:=ADOSelect.Recordset.Fields[0].Value;
ThreadIntro[ThreadFreeListNUm][3]:=ADOSelect.Recordset.Fields[1].Value;
ThreadIntro[ThreadFreeListNUm][4]:=ADOSelect.Recordset.Fields[2].Value;
ThreadIntro[ThreadFreeListNUm][5]:=ADOSelect.Recordset.Fields[3].Value;
TSendSmsThread.Create(ThreadFreeList[ThreadFreeListNUm]);
ThreadFreeListNUm:=ThreadFreeListNUm-1;//采用数组倒置的赋值
end;
ADOSelect.Close;
但是我加了如下一段后在在服务过程中之后启动服务就老说服务魔芋什么可以做 注释掉就可以了,我的服务里面有一个死循环,服务过程是不可能结束的啊,怎么回事
如果我把
i:=0;
while i=0do
begin
ADOSelect.SQL.Clear;//清除上次的数据记录
ADOSelect.SQL.Add('select Id,DesPhone,Content,AddCode From [S_HL_SMSMT] order by ID asc');
ADOSelect.Open;
While not ADOSelect.Eofdo
begin
ThreadIntro[ThreadFreeListNUm][2]:=ADOSelect.Recordset.Fields[0].Value;
ThreadIntro[ThreadFreeListNUm][3]:=ADOSelect.Recordset.Fields[1].Value;
ThreadIntro[ThreadFreeListNUm][4]:=ADOSelect.Recordset.Fields[2].Value;
ThreadIntro[ThreadFreeListNUm][5]:=ADOSelect.Recordset.Fields[3].Value;
TSendSmsThread.Create(ThreadFreeList[ThreadFreeListNUm]);
ThreadFreeListNUm:=ThreadFreeListNUm-1;//采用数组倒置的赋值
end;
ADOSelect.Close;
Sleep(20000);
ServiceThread.ProcessRequests(False);
end
如果我把这段注释掉就好了
ADOSelect.Open;
While not ADOSelect.Eofdo
begin
ThreadIntro[ThreadFreeListNUm][2]:=ADOSelect.Recordset.Fields[0].Value;
ThreadIntro[ThreadFreeListNUm][3]:=ADOSelect.Recordset.Fields[1].Value;
ThreadIntro[ThreadFreeListNUm][4]:=ADOSelect.Recordset.Fields[2].Value;
ThreadIntro[ThreadFreeListNUm][5]:=ADOSelect.Recordset.Fields[3].Value;
TSendSmsThread.Create(ThreadFreeList[ThreadFreeListNUm]);
ThreadFreeListNUm:=ThreadFreeListNUm-1;//采用数组倒置的赋值
end;
ADOSelect.Close;