帮看一下:我写的“信使程序”为何没动作?(50分)

  • 主题发起人 主题发起人 ykjt
  • 开始时间 开始时间
Y

ykjt

Unregistered / Unconfirmed
GUEST, unregistred user!
编译通过,但目标机器上没反应
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
NET_API_STATUS = LongInt;
function NetMessageBufferSend(servername:PWideChar; msgname:PWideChar;fromname:PWideChar; buf:pwidechar; buflen:integer):NET_API_STATUS;stdcall;external 'netapi32.dll';

type
TForm1 = class(TForm)
Edit1: TEdit;
Edit2: TEdit;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
msg:pWideChar;
destname:pWideChar;
begin
destname:=pwidechar(widestring(Edit1.Text)); //目标机器名
msg:=pwidechar(WideString(Edit2.Text)); //发送内容
NetMessageBufferSend(nil,destname,nil,msg,length(Edit2.Text)*2);
end;

end.
 
运行机:win xp
接收机:win nt or win xp
 
现在许多系统把信使服务关闭了
 
本机能收到,其他机器收不到
 
后退
顶部