Forum

Results 1 to 4 of 4
  1. #1
    Join Date
    May 2016
    Posts
    5

    Question Need to get my local IP Address.

    Hello, I need my server.exe to get any computer local address(192.168.1.x) that it is executed on.
    The problem is that I can't include winsock2.h because with the TeamSpeak files it wont compile.
    Is there a way to do this without using windsock2.h?
    Thanks.
    Last edited by patxiku; May 23rd, 2016 at 03:51 PM.

  2. #2
    Join Date
    May 2016
    Posts
    5
    I managed to get this.
    In stead of using winsock2.h I've created a batch file that sends the machine ip to the server exe as parameter when launching.
    Code:
    @echo off
      ipconfig |find "IPv4" > %temp%\TEMPIP.txt
      FOR /F "tokens=2 delims=:" %%a in (%temp%\TEMPIP.txt) do set IP=%%a
      del %temp%\TEMPIP.txt
      set IP=%IP:~1%
    start /d "..\" ts_server.exe %IP%
    Last edited by patxiku; May 23rd, 2016 at 03:51 PM.

  3. #3
    Join Date
    September 2012
    Posts
    6,078
    The SDK compiles just fine for me when including WinSock2.h you just have to define WIN32_LEAN_AND_MEAN beforehand.
    When sending PMs please make sure to include a reference link to the thread in question in the body of your message.

  4. #4
    Join Date
    September 2016
    Location
    Mumbai
    Posts
    1

    Need to get my local IP Address

    Hi patxiku,
    I agree with you....actually I had never know about it....


    properties in mumbai @Hindustanproperty
    Last edited by Ajeet; October 27th, 2016 at 11:58 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •