lawpapa Posted October 27, 2005 Share Posted October 27, 2005 Hey guys Have u got any idea how could i check the ip adress on a certain port? is there any function for it? If no how could i write mine? Sure i would like to do it as an auto script.. The function should decide weather the ip adress is correct or not. It should bring 2 results yes or no. Thanks in advance law Link to comment Share on other sites More sharing options...
BigDod Posted October 27, 2005 Share Posted October 27, 2005 Hey guys Have u got any idea how could i check the ip adress on a certain port?is there any function for it? If no how could i write mine?Sure i would like to do it as an auto script..The function should decide weather the ip adress is correct or not.It should bring 2 results yes or no.Thanks in advancelawIn NT, 2000 and XP you can use the DOS command "ipconfig /all" to obtain all ip address's. Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
ChrisL Posted October 27, 2005 Share Posted October 27, 2005 (edited) @IPAddress1 IP address of first network adapter. Tends to return 127.0.0.1 on some computers. @IPAddress2 IP address of second network adapter. Returns 0.0.0.0 if not applicable. @IPAddress3 IP address of third network adapter. Returns 0.0.0.0 if not applicable. @IPAddress4 IP address of fourth network adapter. Returns 0.0.0.0 if not applicable. Edited October 27, 2005 by ChrisL [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
lawpapa Posted October 27, 2005 Author Share Posted October 27, 2005 Hmm ty for the fast replies.. but i think this is not exactly wot i needlemme explain the problem once again.I dont want to know my own ip adresses. after typing netstat in the command line i will get the folowing results:protokoll: tcp local adress:omnibook:1617 foreign adress: host-219.someting.com:4000219 is the last byte of the foreign ip adress.. and its variable, will be renewed in case of reconnectionThe task of my auto script is to connect my client to the host <--- this step is done check its ip adress <--- this is the step in what i need helpif its correct stay <--- this step wont be problemelse disconnect <--- this step wont be a problemand connect again. <--- sure this wont mean a problem againCan u please tell me something about this ? Link to comment Share on other sites More sharing options...
Nuffilein805 Posted October 27, 2005 Share Posted October 27, 2005 if your connecting to the host via tcpconnect ... then this should be your solution: $ip = SOCKET2IP($ConnectedSocket) Func SOCKET2IP($SHOCKET) $sockaddr = DLLStructCreate("short;ushort;uint;char[8]") $a = DLLCall("Ws2_32.dll","int","getpeername","int",$SHOCKET,"ptr",DLLStructGetPtr($sockaddr), _ "int_ptr",DLLStructGetSize($sockaddr)) If Not @error And $a[0] = 0 Then $a = DLLCall("Ws2_32.dll","str","inet_ntoa","int",DLLStructGetData($sockaddr,3)) If Not @error Then $a = $a[0] Else $a = 0 EndIf DLLStructDelete($sockaddr) Return $a EndFunc this should do the job (from help-file) my little chatmy little encryption toolmy little hidermy unsafe clickbot Link to comment Share on other sites More sharing options...
lawpapa Posted October 27, 2005 Author Share Posted October 27, 2005 ahh ty.. this is more closer. i immediatly try to do something with this function. maybe it ends my suffering Link to comment Share on other sites More sharing options...
w0uter Posted October 27, 2005 Share Posted October 27, 2005 if it doesnt you could try _NetStat My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll 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