This is a blog about Rebol, it's a fantastic free programming language, it permits easily to create complete software with few lines of code. It's cross-platform, so if you write it on Windows, it will work on Linux and Mac, and vice-versa. You can produce also wonderful GUI with just 3 lines of code!
Friday, 10 May 2013
The following script is a net scan, for simple usage is faster than nmap! It calls the ping command.
Scan_Net:does [ iferror?try [ stime:now/time status/text:"Scanning Network ...."show status netw/text:"" netw/line-list: none show netw ; first a ping test to the network broadcast address in order to refresh arp table data commande:join"ping " ["-" countos " "1" " broacast_address] if os ="MacOSX" [wait0.01] ; call external call call/output commande buffer if os ="MacOSX" [wait0.01] ; now we can use arp protocol to know the active computers commande:"arp -a" call/output commande %arp.txt netw/text:read/string%arp.txt etime:now/time diff: etime - stime status/text:join"Process completed in " diff]
[status/text:"Error in Network scanning"] show [netw status]
Get_OS ServerWin:layout [
space 5x5 at8x5 osinfo: info os 100 center info 100to-string Local_host_address
btn 100"Scan Network" [Scan_Net]
btn 70"Quit" [Quit-Requested]
space 0x0 at5x50netw: area 380x150 white white sl: slider 16x150 [scroll-para netw sl] at5x205status: info 395""
] deflag-face netw tabbed view/newcenter-face ServerWin insert-event-func [ eitherall [event/type ='close event/face = ServerWin][quit-requested][event]