命令行里有一个命令是(发送一个字符串到指定的局域网内的ip地址):
net send ip(地址) str(字符串)net 是执行文件
send 表示发送
ip地址 是对方ip
str 是所要发送的字符串我这样用:
ShellExecute(Handle, 'open', 'c:/winnt/system32/net send 192.168.5.21 nihao', nil, nil, SW_SHOWNORMAL);
好像不行

解决方案 »

  1.   

    //我来写uses shellapi;
    procedure TForm1.Button1Click(Sender: TObject);
    var ip:string;
    begin
      ip:='192.168.1.111';
      winexec(pchar('command.com /C '+'Net Send '+ip+' '+'等待发送的信息'),sw_hide);
    end;
      

  2.   

    试试
    ShellExecute(Handle, 'open', 'c:\winnt\system32\net', 'send 192.168.5.21 nihao',  nil, SW_SHOWNORMAL);
      

  3.   

    veryoldman的方法不行,参数不对
      

  4.   

    错怪老者了,你的方法也行,不好意思,只是,我没有弄清楚: xiangwangz的方法是什么意思,有人能解释一下吗
      

  5.   

    VeryOldMan(老者) 的方法没错,可以用,注意要引用一个单元:uses shellapi;。
    ShellExecute(Handle, 'open', 'c:\winnt\system32\net', 'send 192.168.5.21 nihao',  nil, SW_SHOWNORMAL);