testingtest Posted November 7, 2007 Share Posted November 7, 2007 hello i need some help please i want to get info from the server for example the computer name and then send the computer name over to the client i know i would have to use TCPRecv and and TCPSend but how do i tell it what info i want from the socket i bet it's not even hard to do but for me to have to think of the process is hurting my head i tell it what socket i am connected to and tell it how much data i want send and recv but no option to pick the data you want back Link to comment Share on other sites More sharing options...
Nahuel Posted November 7, 2007 Share Posted November 7, 2007 You want something like this?Server:;Server Script. RUN FIRST TCPStartUp() $MainSocket = TCPListen(TCPNameToIP(@computername), 65432, 100 ) If $MainSocket = -1 Then Exit While 1 $ConnectedSocket = TCPAccept( $MainSocket) If $ConnectedSocket >= 0 Then msgbox(0,"","connected",1) ExitLoop EndIf Wend While 1 $Message=TCPRecv($ConnectedSocket,2048) Sleep(25) If $Message<>"" Then Switch $Message Case "IPAddress" $Info=@IPAddress1 Case "ComputerName" $Info=@ComputerName Case "UserName" $Info=@UserName Case "LogonDomain" $Info=@LogonDomain Case Else $Info="Unknown command" EndSwitch TCPSend($ConnectedSocket,$Info) EndIf WEndRun the server at the remote computer, then run the client at yours. Enter the info you want to get from the server (IPAddress,ComputerName,UserName,etc...)Should work. Link to comment Share on other sites More sharing options...
testingtest Posted November 7, 2007 Author Share Posted November 7, 2007 (edited) Thanks just what I wanted your my hero Edited November 7, 2007 by testingtest Link to comment Share on other sites More sharing options...
jokke Posted November 15, 2007 Share Posted November 15, 2007 (edited) you sure you have port 65432 open? Edit: and forwarded to your server computer. (inncase you are running this script over internet) Edited November 15, 2007 by jokke UDF:Crypter a file encrypt / decrypt tool with no need to remember a password again. Based on Caesar cipher using entire ASCII Table.Script's: PixelSearch Helper, quick and simple way to create a PixelSeach.Chatserver - simplified, not so complicated multi-socket server.AutoIT - Firewall, simple example on howto create a firewall with AutoIt. Link to comment Share on other sites More sharing options...
magician13134 Posted November 15, 2007 Share Posted November 15, 2007 (edited) Sorry, I deleted it because I got it working with IP 192.168.0.11... but now I'm trying it with a friend, and I can't get it working again. How do I know if the port is open? And do the computers need to be on the same network? Or could I be running this script with someone halfway across the globe? Edited November 15, 2007 by magician13134 Visit Magic Soft Inc. for some of my software 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