Demon777 Posted December 14, 2007 Share Posted December 14, 2007 Hello all. I need help again... Today its a Network. I wanna make program that connecting to Server per Network (Lan). But i need to know how to make this program to read IP what i tuped in InputBox on my Form. I wanna do so : Program should Read IP that was typed in Inputbox and connect to it. + Should i use TCPConnect functions ? plz help Thx Link to comment Share on other sites More sharing options...
Demon777 Posted December 14, 2007 Author Share Posted December 14, 2007 Just forgot /// How to meke this program send functions what i want to Server ??? And Server should do it.... For Exampel 1 Message. Plz say me how Link to comment Share on other sites More sharing options...
Demon777 Posted December 14, 2007 Author Share Posted December 14, 2007 No one ??? Please peoples... How can i make this : TO make Client able to connect with Server and able to Send Commands to server. Please... Realy need... Link to comment Share on other sites More sharing options...
John117 Posted December 14, 2007 Share Posted December 14, 2007 seehttp://www.autoitscript.com/forum/index.ph...=45189&st=0last page client and server. If you dont understand you will have to learn. I doubt you will find many people on here willing to get into something so complicated for someone that does not have a starting script. this could be days of work. Link to comment Share on other sites More sharing options...
Demon777 Posted December 15, 2007 Author Share Posted December 15, 2007 (edited) Ok thx... But i have another problemm with it... For exampel : This is simple server that i took in post where its all about. But i dont need any natifications that Data arrived and so on.... I wanna make it just to become commands and server should make them.... I need no GUI and so on just commands... I thinked about that Client will send 'CD' command for exampel and when Server will become this command it ll open CD-ROM.... So >>>??? Any Ideas ???? BTW. I dont realy know how to modify this simple server So plz help :| It should just recive commands that i sending and make them... No GUI, No TrayIcon... expandcollapse popup#include <ASock.au3> Const $MYMSG = 1024 ;;; Const $PORT2LISTEN = 42775 ;;; Global $hNotifyGUI = GUICreate( "notify" ) Global $hListen Global $hAccepted = -1 If Not TCPStartup( ) Then Exit 1 If Not _StartServer( "0.0.0.0", $PORT2LISTEN, "OnEvent" ) Then Exit 2 ConsoleWrite( "+> Waiting for connection on port #" & $PORT2LISTEN & "..." & @CRLF ) While $hAccepted = -1; You can alse use a flag like $bConnected which would be changed by OnAccept() ; when a connection is accepted... ; blah blah... WEnd ; Connection accepted! ConsoleWrite( "Connection accepted, socket #" & $hAccepted & @CRLF ) While $hAccepted <> -1; While still connected ; Do whatever you like here. ; Do GUI handling etc. WEnd TCPCloseSocket( $hListen ) TCPShutdown( ) Exit 0 ; This is called when an event has happened on a socket. Func OnEvent( $hWnd, $iMsgID, $WParam, $LParam ) Local $hSocket = $WParam; Get the socket involved (either $hListen or $hAccepted in this example) Local $iError = _HiWord( $LParam ); If error is 0 then the event indicates about a success Local $iEvent = _LoWord( $LParam ); The event: incoming conn / data received / perfect conditions to send / conn closed Local $sDataBuff If $iMsgID = $MYMSG Then; Winsock, not Windows GDI Switch $iEvent Case $FD_ACCEPT; Incoming connection! If $iError <> 0 Then Exit MsgBox( 16, "simpleServer error", "Failed to listen to " & $PORT2LISTEN & "." ) EndIf $hAccepted = TCPAccept( $hListen ) Case $FD_READ; Data has arrived! If $iError <> 0 Then TCPCloseSocket( $hAccepted ) $hAccepted = -1 Else $sDataBuff = TCPRecv( $hAccepted, 8192 ) If @error Then TCPCloseSocket( $hAccepted ) $hAccepted = -1 Else ConsoleWrite( "{{" & $sDataBuff & "}}" & @CRLF ) TrayTip( "Data has arrived!", $sDataBuff, 30 ) EndIf EndIf Case $FD_WRITE If $iError <> 0 Then TCPCloseSocket( $hAccepted ) $hAccepted = -1 EndIf Case $FD_CLOSE; Bye bye _ASockShutdown( $hAccepted ); Graceful shutdown. Sleep( 1 ) TCPCloseSocket( $hAccepted ) $hAccepted = -1 EndSwitch EndIf EndFunc Func _StartServer( $sIP, $iPort, $sFunc ) $hListen = _ASocket( ) If @error Then Return False _ASockSelect( $hListen, $hNotifyGUI, $MYMSG, BitOR( $FD_ACCEPT, $FD_READ, $FD_WRITE, $FD_CLOSE ) ) If @error Then Return False GUIRegisterMsg( $MYMSG, $sFunc ) _ASockListen( $hListen, $sIP, $iPort ) If @error Then Return False Return True EndFunc Thx... Edited December 15, 2007 by Demon777 Link to comment Share on other sites More sharing options...
John117 Posted December 15, 2007 Share Posted December 15, 2007 (edited) Ok thx... But i have another problemm with it... For exampel : This is simple server that i took in post where its all about. But i dont need any natifications that Data arrived and so on.... I wanna make it just to become commands and server should make them.... I need no GUI and so on just commands... I thinked about that Client will send 'CD' command for exampel and when Server will become this command it ll open CD-ROM.... So >>>??? Any Ideas ???? BTW. I dont realy know how to modify this simple server So plz help :| It should just recive commands that i sending and make them... No GUI, No TrayIcon... [i've had a little interest in the past in the script I pointed out. I will see if next week I can work something up in it. -maybe label it so you can delete what ever you want . . . btw -it soulds like you are writing something from 99 thats be classified as a malware. - if your final request seems to be something like this, then I doubt anyone will help you. That does nothing but hurt autoit and I like it to much to get classified as malware in general. Edited December 15, 2007 by Hatcheda Link to comment Share on other sites More sharing options...
Demon777 Posted December 15, 2007 Author Share Posted December 15, 2007 Its not a malware.... Just a useful programm that i will use on my PC to send files to my another pc and so on... Becouse my LAN dont work correctly (Lan Cable) So its a point to use it coz i have also Router so.... I can enter another PC's IP and send file that i want.... Or download from my another PC back.... U wanna know why i am not using Total Commander or so ??? Easy answer : My Router !!! So dont afraid that i am making bad things Link to comment Share on other sites More sharing options...
John117 Posted December 15, 2007 Share Posted December 15, 2007 1. wrong answer buddy, if it is the router then you could work out the following. Router settings: Applications (router specific wording) Port Range Forward make up an application name use the port of the application for start end give the ip address of the computer you wish to work with. done. 2. If its really the router, than anything anyone builds will have the same firewall problem. since they all use ports. 3. they are both your computers, right? you have the passwords, right? -FlashFXP- free trial for a month. you can look at the other computer without popups to me it sounds like you want to do stuff on the other pc with out any form of notification. what I hear you saying is you want to sneak. if you have the passwords then perhaps you are allowe to sneak, in which case an ftp client would work for you. Link to comment Share on other sites More sharing options...
Demon777 Posted December 15, 2007 Author Share Posted December 15, 2007 Thats mean that u ll not help me, right ? Ok. btw i wanted to make programm for this by myself but it seems to be that no one can help me here.... So.... ok.... Link to comment Share on other sites More sharing options...
John117 Posted December 15, 2007 Share Posted December 15, 2007 if its really what you wanted if for, then I gave you a better alternative. -and faster. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now