一个简单的UDP发送消息,判断它是否发送成功,怎么捕捉?
比如:
Winexec(pchar('net send ' +IP+ ' ' +Memo1.Text),SW_HIDE);
if 发送成功 then 我该如何判断这个‘发送成功’、失败、或其他状态????
比如:
Winexec(pchar('net send ' +IP+ ' ' +Memo1.Text),SW_HIDE);
if 发送成功 then 我该如何判断这个‘发送成功’、失败、或其他状态????
If the function fails, the return value is one of the following error values: Value Meaning
0 The system is out of memory or resources.
ERROR_BAD_FORMAT The .EXE file is invalid (non-Win32 .EXE or error in .EXE image).
ERROR_FILE_NOT_FOUND The specified file was not found.
ERROR_PATH_NOT_FOUND The specified path was not found.
showmessage('成功');
else
showmessage('失败');
var i : Integer;
begin
i := Winexec(pchar('net send ' +'192.168.0.100' + ' ' +Memo1.Text),SW_HIDE);
if (i>31) then
ShowMessage('Succesful!')
else
ShowMessage('May be get some error!');
end;每次信息提示都为:Succesful!
继续up
你想要的返回值是net send(netmessagebuffersend)的返回值,是发送成功与否