T toneyf Unregistered / Unconfirmed GUEST, unregistred user! 2002-01-22 #1 在使用nmudp时,通信双方无法连接时会出现这个错误,怎么解决? 或者我想变通一下,先判断是否连接正常再发送,又该怎么做呢?
D drawpharos Unregistered / Unconfirmed GUEST, unregistred user! 2002-01-22 #2 拦截异常! try ... except ... end
T toneyf Unregistered / Unconfirmed GUEST, unregistred user! 2002-01-22 #3 没有效果好像。。请帮忙分析一下 procedure TForm1.btLoginClick(Sender: TObject); var mystream:tmemorystream; tmpstr:string; begin tmpstr:=eddept.Text; mystream:=tmemorystream.Create; try try mystream.Write(tmpstr[1],length(tmpstr)); NMUDP1.ReportLevel := 0; nmudp1.SendStream(mystream); finally mystream.Free; end; except // on EwriteErrordo // showmessage('请检查网络连接情况'); end; end;
没有效果好像。。请帮忙分析一下 procedure TForm1.btLoginClick(Sender: TObject); var mystream:tmemorystream; tmpstr:string; begin tmpstr:=eddept.Text; mystream:=tmemorystream.Create; try try mystream.Write(tmpstr[1],length(tmpstr)); NMUDP1.ReportLevel := 0; nmudp1.SendStream(mystream); finally mystream.Free; end; except // on EwriteErrordo // showmessage('请检查网络连接情况'); end; end;