测试点击软件时能上传数据,使用电脑启动软件却不能上传数据?
我制作一个软件,每2分钟自动上传一次数据,我测试的时候没有问题,但是,我将软件加到注册表的run里面启动软件的时候,软件2分钟后没有任何反应,奇怪,以下是我程序的代码,请高手看看,谢谢!
procedure Tc_Form.up_TimerTimer(Sender: TObject);
var
F : TextFile ;
S : string;
I : integer ;
s_title , s_process , s_times : string ;
begin
{$REGION 'show_memo信息上传到服务器'}
if show_memo.Text <> '' then
begin
try
server_adoconnection.Connected := true;
for I := 0 to show_memo.Lines.Count - 1 do
begin
s_title := '';
s_process := '';
s_times := '';
if show_memo.Lines.Strings[i] <> '' then
begin
//解析数据
s_title := copy(show_memo.Lines.Strings[i],1,9) ; //解析出 s_title
s_process := copy(show_memo.Lines.Strings[i],11,length(trim(show_memo.Lines.Strings[i])) - 30) ; //解析出 s_process
s_times := copy(show_memo.Lines.Strings[i],length(trim(show_memo.Lines.Strings[i])) - 18,19 ) ; //解析出 s_times
With server_ADOQuery do begin
close;
sql.Clear;
sql.Add('select * from process_show_table');
open;
insert; //解析后上传到服务器
Fields.FieldByName('title').AsString := trim(s_title) ;
Fields.FieldByName('process').AsString := trim(s_process) ;
Fields.FieldByName('times').AsString := trim(s_times) ;
Fields.FieldByName('ipad').AsString := trim(computer_ipad);
post;
end;
end;
end;
show_memo.Clear;
except
end;
end;
{$ENDREGION}
end;