;region Script Settings ;WKIX32.EXE ; ;%TEMP% ;C:\Documents and Settings\dale\Desktop\send kixtar exe over stream ; ;True ; ;True ; ;False ;True ;True ;False ; ; ;True ; ; ;1.0.0.1 ; ; ; ; ; ; ; ;endregion "KiXforms TCP connection Example script by Jooel 14th of December 2005" ? "Client Side." ? ? "the Server side script must be listening before running this script." ? $s = CreateObject("Kixforms.System") ? $ = SetOption("wrapateol","on") $File = $s.FileStream(%systemroot%+"\System32\wkix32.exe",$s.filemode_open,$s.fileaccess_read) @serror ? $contentOfExe = $File.Read(0,$File.Length) "File Size: " $File.Length ? "total size: " Ubound($contentOfExe)/1024 "kBytes" ? @serror ? If @error Get $ Quit 0 EndIf "Opening a connection to the server: " $connection = $s.tcpClient("localhost",2332) @SERROR ? If @ERROR ? "error occured. quitting..." Sleep 5 Quit EndIf "Opening the NetworkStream: " $NetStream = $connection.getStream() @SERROR ? If @ERROR ? "error occured. quitting..." Sleep 5 Quit EndIf If Not $NetStream.canWrite ? "Can't write to the stream, so..." Sleep 0.5 ? " can't really demonstrate writing to it, can I?" Sleep 0.2 ? " Quitting..." Sleep 5 Quit EndIf /* $File = $s.FileStream("C:\winnt\system32\wkix32.exe",$s.filemode_open,$s.fileaccess_read) @serror ? $contentOfExe = $File.Read(0,$File.Length) "File Size: " $File.Length ? "total size: " Ubound($contentOfExe)/1024 "kBytes" ? @serror ? */ ?? "K, now it's time to send a small string over the line." ? $NetStream.Write($contentOfExe, 0, Ubound($contentOfExe)+1) @SERROR ?? "done. this script has finished." ? " Check out the server side script's window" ? " wether the sent string came trought." ? ? "press some key to close this window." Get $