Форум: "Сети";
Текущий архив: 2004.04.04;
Скачать: [xml.tar.bz2];
Внизпочта по локальой сети Найти похожие ветки
← →
fyz (2004-01-30 18:21) [0]как написать сообщение по локалке используя dos-команду Net send
← →
Manulo © (2004-01-30 18:26) [1]не такая она уж и дос :(
net send {ip-adress} Bla-bla-bla
+F1 ShellExecute
← →
Rouse_ © (2004-01-30 20:46) [2]
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
const
NetApi32 = "NetApi32.dll";
function NetMessageBufferSend(
servername:PWideChar ;
msgname:PWideChar ;
fromname:PWideChar ;
buf:PWideChar ;
buflen:DWORD):DWORD;stdcall;
var
Form1: TForm1;
implementation
function NetMessageBufferSend; external NetApi32 name "NetMessageBufferSend";
{$R *.dfm}
Function SendLanMessage(FromName,ToName:String;Text:String):Boolean;
Var
RName,TName,HostName: LPCWSTR;
buf: Pointer;
size: Integer;
Begin
Result:=True;
HostName:=nil;
size := SizeOf (WideChar) * Length (FromName)+1;
GetMem (RName, Size);
RName :=StringToWideChar (FromName, RName, Length (FromName)+1);
size := SizeOf (WideChar) * Length (ToName)+1;
GetMem (TName, Size);
TName :=StringToWideChar (ToName, TName, Length (ToName) + 1);
// Перевод String в WideString
size := SizeOf (WideChar) * Length (text)+1;
GetMem (buf, Size);
TRY
PWideChar (Buf) := StringToWideChar (text, buf, Length (text) + 1);
If NetMessageBufferSend (HostName, rname, tname, buf, size) <> NO_ERROR
then Result:=False;
FINALLY
FreeMem(buf);
IF assigned(TNAME) then FreeMem(TName);
IF assigned(RNAME) then FreeMem(RName);
IF assigned(HOSTNAME) then FreeMem(HOSTNAME);
END;
End;
procedure TForm1.Button1Click(Sender: TObject);
begin
SendLanMessage(<кому>, <от кого>, <сообщение>);
end;
end.
Желаю успехов
← →
MadSliMX (2004-01-31 13:17) [3]Чё мазги парить-то!!!!
WinExec("net send 192.168.0.1 qweqwe",SW_HIDE);
Страницы: 1 вся ветка
Форум: "Сети";
Текущий архив: 2004.04.04;
Скачать: [xml.tar.bz2];
Память: 0.45 MB
Время: 0.03 c