Вверх ↑
Ответов: 784
Рейтинг: 168
#1: 2022-08-31 06:47:23 ЛС | профиль | цитата
Пример передачи данных из PowerShell по протоколу UDP.

Add(MainForm,10237418,105,273)
{
Left=20
Top=105
Width=550
Height=387
Caption="Test"
ClientSize=0
Point(onClose)
link(onCreate,6678770:doOpen,[])
link(onClose,6678770:doClose,[(158,300)(158,314)])
}
Add(UDP,6678770,168,287)
{
LocalPort=1002
LocalIP="127.0.0.1"
Point(LocalIP)
link(onReceive,4168011:doCharset,[])
}
Add(WinExec,11401622,294,105)
{
FileName="powershell"
Mode=0
Action="runas"
Point(doConsoleExec)
Point(doConsoleInput)
Point(onConsoleTerminate)
Point(onConsoleResult)
Point(onConsoleError)
}
Add(FormatStr,4794102,231,119)
{
DataCount=1
Mask="$Message = '%1'\r\n[int]$Port = 1002\r\n$IP = '127.0.0.1'\r\n\r\n$Address = [system.net.IPAddress]::Parse($IP)\r\n$End = New-Object System.Net.IPEndPoint $address, $port\r\n$Saddrf = [System.Net.Sockets.AddressFamily]::InterNetwork\r\n$Stype = [System.Net.Sockets.SocketType]::Dgram\r\n$Ptype = [System.Net.Sockets.ProtocolType]::UDP\r\n$Sock = New-Object System.Net.Sockets.Socket $saddrf, $stype, $ptype\r\n$Sock.TTL = 26\r\n$sock.Connect($End)\r\n# $Enc = [System.Text.Encoding]::ASCII\r\n$Enc = [System.Text.Encoding]::Unicode\r\n$Buffer = $Enc.GetBytes($Message)\r\n$Sent = $Sock.Send($Buffer)\r\n\r\n\r\n"
link(onFString,11401622:doConsoleExec,[])
link(Str1,3013988:Text,[])
}
Add(Menu,8475728,105,112)
{
Menu=#4:Send|5:Clean|
Point(onSelectNum)
link(onSelectNum,16231780:doEvent,[])
}
Add(Charset,4168011,217,287)
{
Type=9
link(onCharset,11001438:doConvert,[])
}
Add(IndexToChanel,16231780,168,119)
{
link(onEvent1,4794102:doString,[])
link(onEvent2,1332877:doClear,[(221,132)(221,167)])
}
Add(StrList,3013988,231,63)
{
Strings=#42:Артикул;Название;Кол-во;Ед.изм.;Цена;Сумма|56:23544122;Carbon disc ?44,7/38,3x5,8mm;10;PC;16,92;169,20|56:23544122;Carbon disc ?44,7/38,3x5,8mm;10;PC;16,92;169,20|54:23544122;Carbon disc ?44,7/38,3x5,8mm;2;PC;16,92;33,84|64:21200159;Top part UNIFL3/4 for steel bot.part;25;PC;30,09;752,25|57:24400111;Hose f. pump compl. UNIWASH;153;PC;10,58;1618,74|58:13225;Piston complete for valve UNIWASH3;4;PC;27,09;108,36|60:12200105;Vacuumgauge glycerine ?100mm 3/8";5;PC;40,57;202,85|54:21200141;Thread bush UNIFLOW3 steel;130;PC;1,93;250,90|45:25100146;O-ring ?16,1x1,6mm;175;PC;0,36;63,00|57:21200127;Holder rocking lever, UNIFLOW3;170;PC;0,26;44,20|50:21200131;Rocking lever UNIFLOW3;150;PC;0,89;133,50|65:25200132;Valve button inside UNIFLOW3 steel FA;225;PC;0,72;162,00|61:21200129;Bar closing device UNIFLOW3 steel;225;PC;1,09;245,25|55:25200124;Valve flap outside UNIFLOW3;225;PC;1,56;351,00|60:14400212;Solenoid valve sgl. invensys 230vac;5;PC;8,50;42,50|62:14400213;Solenoid valve dobb. invensys 230vac;5;PC;14,13;70,65|48:21200131;Rocking lever UNIFLOW3;20;PC;0,89;17,80|63:25200132;Valve button inside UNIFLOW3 steel FA;20;PC;0,72;14,40|43:25100146;O-ring ?16,1x1,6mm;20;PC;0,36;7,20|55:21200127;Holder rocking lever, UNIFLOW3;20;PC;0,26;5,20|58:21200130;Bar closing device UNIFLOW3 steel;20;PC;0,34;6,80|58:25200119;Guard bracket UNIFLOW3 steel SBS;20;PC;3,38;67,60|55:13474;Valve flap exterior UNIFLOW3 SBS;20;PC;1,56;31,20|59:26400104;Terminal wheel for lock guide str;20;PC;1,12;22,40|67:25215022;Rubber liner UNIFL. 15022-?22 UNIFLEX FA;96;PC;2,39;229,44|55:14800695;Hose guide f. SAC115 complete;10;PC;9,17;91,70|36:14306;Filter for IDC;20;PC;0,40;8,00|51:25515435;Rubber hose ?27/16 mm - FA;15;M;5,24;78,60|63:13930;Double-action Quickstart II rem. L=740mm;1;PC;98,66;98,66|54:13100201;Spray gun for udder washer;20;PC;17,77;355,40|0:|
}
Add(StreamConvertor,11001438,266,287)
{
Mode=7
link(onResult,11559680:doLoadFromStream,[])
}
Add(MST_Load,11559680,315,280)
{
MSTControl="asd"
link(onLoadFromStream,681341:doColAction,[])
}
Add(MTStrTbl,9953103,448,287)
{
Left=405
Top=210
Align=5
Name="asd"
}
Add(MST_Clear,1332877,231,161)
{
MSTControl="asd"
}
Add(MST_ColAction,681341,371,287)
{
Action=9
Index=-2
MSTControl="asd"
}

карма: 15

0