请教各位:在WIN2000的cmd 中命令问题?(50分)

  • 主题发起人 主题发起人 kit
  • 开始时间 开始时间
K

kit

Unregistered / Unconfirmed
GUEST, unregistred user!
在WIN2000的cmd 中局域网发消息的命令是什么?
 
net send "message"
 
net send ip message
例:
net send 192.168.0.64 出去抽去烟
 
我自己刚写了一个用delphi发的
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls;

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



var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
i,j:integer;
begin
i:=strtoint(edit2.text);
for j:=0 to i do
begin
winexec(pchar('net send '+edit1.Text+' '+ memo1.text),sw_hide);
sleep(1000);
end;
end;

end.
 
在服务中有个消息消息,把它打开才可以用
 
开始--运行,然后输入,格式为:
net send IP(或机器名) 发言内容。
 
net send , 不过net这个command还其他很多妙用,你看一下help!
 
to lcl_003:
net send哪用得着调DOS命令,你可以直接用Delphi编程做到。

unit SendMsgUnit;
interface
uses SysUtils, Classes;

function ToUnicode(str:string;dest:PWideChar):integer;
function SendMsg(Toh,From,Msg:string):integer;
function NetMessageBufferSend(servername:PWideChar;
MsgName:PWideChar;
FromName:PWideChar;
Buf: PWideChar;
var BufLen:integer):integer;cdecl;
implementation

function ToUnicode(str:string;dest:PWideChar):integer;
var
len:integer;
begin
//len:=0;
StringToWideChar(str,dest,len);
Result:=len;
end;


function NetMessageBufferSend; external 'netapi32.dll' name 'NetMessageBufferSend';

function SendMsg(Toh,From,Msg:string):integer;
var
ToName :array [0..64] of WideChar;
FromName :array [0..64] of WideChar;
WMsgText:array [0..1000] of WideChar;
MsgLen, i:integer;
begin
for i := 0 to 64 do ToName := #0;
ToUnicode(Toh,ToName);

for i := 0 to 64 do FromName := #0;
ToUnicode(From,FromName);

for i := 0 to 1000 do WMsgText := #0;
ToUnicode(Msg,WMsgText);

Result:=NetMessageBufferSend(nil,ToName,nil,@WMsgText,MsgLen);
end;

end.
 
接受答案了.
 
后退
顶部