cdkid Posted September 6, 2007 Posted September 6, 2007 So I'm using a modified version of the RemoteAutoit script to allow remote restarts for a server i'm running. It works fine, but I want to add logging to it and i was wondering if there was any way to retrieve the IP from the TCP functions (TCPRecv, Accept etc..) Any help would be much appreciated. ~cdkid AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!
Moderators SmOke_N Posted September 6, 2007 Moderators Posted September 6, 2007 (edited) I don't remember who I stole this from :Func _TCPGetIP($nSocket) Local $stcSockAddress = DllStructCreate('short;ushort;uint;char[8]') Local $aWS232DLL = DllCall('Ws2_32.dll', 'int', 'getpeername', 'int', $nSocket, _ 'ptr', DllStructGetPtr($stcSockAddress), 'int_ptr', DllStructGetSize($stcSockAddress)) If @error = 0 And $aWS232DLL[0] = 0 Then $aWS232DLL = DllCall('Ws2_32.dll', 'str', 'inet_ntoa', 'int', DllStructGetData($stcSockAddress, 3)) $stcSockAddress = 0 If IsArray($aWS232DLL) Then Return $aWS232DLL[0] EndIf $stcSockAddress = 0 Return SetError(1, $stcSockAddress = 0, 0) EndFunc Edited September 6, 2007 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
cdkid Posted September 6, 2007 Author Posted September 6, 2007 Great, thanks smoke! worked like a charm. ~cdkid AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!
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