请教:
我 客户端 是 通过 ADO  访问数据库的,当数据库要进行恢复时,首先要告诉客户端:"数据库在什么时候要进行恢复了"
怎样才能实现这样的功能呢? 怎么知道局地域网内有那些客户端呢?(是用 winsocket 吗?)还有 :如果在 开始--->运行 中敲入: net  send  {name} message 这样的能在 delphi 程序表示出来吗?请各位大哥,最好是给个列子,因为我真的很菜啊~~
谢谢各位老大!

解决方案 »

  1.   

    比如你用ADOCONNECTION连接,那么在断开的事件中写上showmessage这样写就行了
    winexec('net  send  {name} message',sw_hide);
      

  2.   

    net  send  {name} message 是在命令窗口下。
    不行你就试下winexec('net  send  {name} message',sw_hide); 这也会有黑窗口出现
      

  3.   

    winexec('net  send  IP message',0);
      

  4.   

    请教各位大哥,这样为什么不行呢?
    procedure tform1.button1click(sender:tobject);
    var
          i:integer;
    begin
          for  i:=2 to 12
               begin
                     winexec('net  send  192.168.0.i  message',0);
               end;
    end;当我单击 button1 ,为什么只有在 IP  地址为:192.168.0.12  的计算机上出现了
    信息对话框,而 :192.168.0.2----192.168.0.11 的计算机都没有出现信息对话框
    还有   192.168.0.12  的计算机上出现 信息对话框 有12 个,这是为什么呢?
    谢谢!
      

  5.   

    winexec(pchar(format('net  send  192.168.0.%d  message',[i])),0);
      

  6.   

    信使服务可以用mailslot,推荐一个好用的方法
    function NetMessageBufferSendSubstA(ServerName, MsgName, FromName, Msg: AnsiString): Boolean; 
    {.$DEFINE SYNCHRONOUS}
    const 
      szService = '\mailslot\messngr'; 
      MaxBufLen = $700; 
    var 
      hFile: THandle; 
      WrittenBytes: DWORD;
    {$IFNDEF SYNCHRONOUS} 
      ovs: OVERLAPPED; 
      EventName:String; 
    {$ENDIF} 
    begin
      Result := False;
      if Length(Msg) > MaxBufLen then
        SetLength(Msg, MaxBufLen);
    {$IFNDEF SYNCHRONOUS}
      EventName:='NetSendEvent_'+ServerName;
    {$ENDIF} 
      ServerName := '\\' + Servername + szService;
      hFile := CreateFileA(
        @ServerName[1], GENERIC_WRITE, FILE_SHARE_READ, nil, OPEN_EXISTING,
        FILE_ATTRIBUTE_NORMAL or FILE_FLAG_NO_BUFFERING or FILE_FLAG_OVERLAPPED, 0);
      if hFile <> INVALID_HANDLE_VALUE then
      try 
        Msg := FromName + #0 + MsgName + #0 + Msg;
    {$IFNDEF SYNCHRONOUS} 
        ovs.hEvent := CreateEventA(nil, True, False, @EventName[1]);
        WriteFile(hFile, Pointer(Msg)^, Length(Msg), WrittenBytes, @ovs); 
    {$ELSE}
        WriteFile(hFile, Pointer(Msg)^, Length(Msg), WrittenBytes, nil); 
    {$ENDIF}
        Result := GetLastError = ERROR_IO_PENDING;
      finally
    {$IFNDEF SYNCHRONOUS}
        if WaitForSingleObject(ovs.hEvent, INFINITE) <> WAIT_TIMEOUT then
    {$ENDIF} 
          CloseHandle(hFile);
      end;
    end;
      

  7.   

    谢谢上面的各位大哥,
    请教:jinjazz 大哥,我那些写是错误在那里啊?
    您写的第二个是很好,可是我我现在的水平还不够,以后慢慢研究啊!
    谢谢!