Jump to content
Sign in to follow this  

tcp getting info from server

Recommended Posts

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

Share this post

Link to post
Share on other sites

You want something like this?


;Server Script. RUN FIRST
$MainSocket = TCPListen(TCPNameToIP(@computername), 65432,  100 )
If $MainSocket = -1 Then Exit
While 1
    $ConnectedSocket = TCPAccept( $MainSocket)
    If $ConnectedSocket >= 0 Then
While 1
    If $Message<>"" Then
        Switch $Message
            Case "IPAddress"
            Case "ComputerName"
            Case "UserName"
            Case "LogonDomain"
            Case Else
                $Info="Unknown command"

Run 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.

Share this post

Link to post
Share on other sites

you sure you have port 65432 open?

Edit: and forwarded to your server computer. (inncase you are running this script over internet)

Edited 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.

Share this post

Link to post
Share on other sites

Sorry, I deleted it because I got it working with IP 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 by magician13134

Share this post

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...