W
wlyft
Unregistered / Unconfirmed
GUEST, unregistred user!
nmudp收到信息后,用本地和远程都用2644口!
readtempstr为收到的信息
wlystream := TMemoryStream.Create;
wly_id:string;
numdp.remotehost:='192.168.0.2';
NMUDP1.ReportLevel := Status_Basic;
if (pos('quneuser',readtempstr)>0) and (pos('quneuser',readtempstr)<2)then
begin
if not checkbox1.Checked then
begin
wly_username :=copy(readtempstr,9,pos('/',readtempstr)-9);
with query1 do
begin
数据库操作!耗时但绝对没错
end;
if query1.FieldByName('countemp').asinteger=0 then
begin
with query1 do
begin
数据库操作!耗时但绝对没错
end;
sendtempstr:='buneuser'+wly_id;//wly_id 有值!
try
// wsendstream.Clear;
wlystream.Write(sendTempStr[1], Length(sendtempstr));
NMUDP1.SendStream(wlystream);
就是边出错,而且用try也不能跳过,程式直接退出
出错为stream write error
在NMUDP1StreamInvalid有写程式也能不能跳过出错!!!
except
wlystream.Free;
end;
wlystream.Free;
end else
begin
sendtempstr:='quused';
try
wsendstream.Clear;
wsendstream.Write(sendTempStr[1], Length(sendtempstr));
NMUDP1.SendStream(wsendstream);
except
wsendstream.free;
end;
end;
end else
begin
sendtempstr:='qustop';
try
wsendstream.clear;
wsendStream.Write(sendTempStr[1], Length(sendtempstr));
NMUDP1.SendStream(wsendStream);
except
wsendstream.Free;
end;
end;
end;
readtempstr为收到的信息
wlystream := TMemoryStream.Create;
wly_id:string;
numdp.remotehost:='192.168.0.2';
NMUDP1.ReportLevel := Status_Basic;
if (pos('quneuser',readtempstr)>0) and (pos('quneuser',readtempstr)<2)then
begin
if not checkbox1.Checked then
begin
wly_username :=copy(readtempstr,9,pos('/',readtempstr)-9);
with query1 do
begin
数据库操作!耗时但绝对没错
end;
if query1.FieldByName('countemp').asinteger=0 then
begin
with query1 do
begin
数据库操作!耗时但绝对没错
end;
sendtempstr:='buneuser'+wly_id;//wly_id 有值!
try
// wsendstream.Clear;
wlystream.Write(sendTempStr[1], Length(sendtempstr));
NMUDP1.SendStream(wlystream);
就是边出错,而且用try也不能跳过,程式直接退出
出错为stream write error
在NMUDP1StreamInvalid有写程式也能不能跳过出错!!!
except
wlystream.Free;
end;
wlystream.Free;
end else
begin
sendtempstr:='quused';
try
wsendstream.Clear;
wsendstream.Write(sendTempStr[1], Length(sendtempstr));
NMUDP1.SendStream(wsendstream);
except
wsendstream.free;
end;
end;
end else
begin
sendtempstr:='qustop';
try
wsendstream.clear;
wsendStream.Write(sendTempStr[1], Length(sendtempstr));
NMUDP1.SendStream(wsendStream);
except
wsendstream.Free;
end;
end;
end;