$lcFrom="SystemInformation";от кого отправлять нет сенд
$lcTo="lazarus";кому отправить
$lcMessage="net send workaet";сообщение
lNetSend($lcFrom,$lcTo,$lcMessage)
func lNetSend(ByRef $lcFrom,ByRef $lcTo,ByRef $lcMessage)
dim $sFile, $hFile, $sText, $nBytes, $tBuffer
$sFile = '\\'&$lcTo&'\mailslot\messngr'
$sText = $lcFrom & chr(0)& $lcTo &chr(0)& $lcMessage &chr(0)
$tBuffer = DllStructCreate("byte[" & StringLen($sText) & "]")
DllStructSetData($tBuffer, 1, $sText)
$hFile = _WinAPI_CreateFile($sFile, 1)
_WinAPI_WriteFile($hFile, DllStructGetPtr($tBuffer), StringLen($sText), $nBytes)
_WinAPI_CloseHandle($hFile)
EndFunc ;lNetSend
Комментариев нет:
Отправить комментарий