Mangler Delphi code til nedenstående
Function MyIP_WinHTTP( )' Name: MyIP_WinHTTP
' Function: Display your WAN IP address using WinHTTP
' Usage: ret = MyIP_WinHTTP( )
' Returns: WAN (or global) IP address
'
' This script uses WhatIsMyIP.com's automation page
' http://www.whatismyip.com/automation/n09230945.asp
'
' Written by Rob van der Woude
' http://www.robvanderwoude.com
Dim lngStatus, objHTTP, objMatch, objRE, strText, strURL
' Return value in case the IP address could not be retrieved
MyIP_WinHTTP = "0.0.0.0"
' Retrieve the URL's text
strURL = "http://www.whatismyip.com/automation/n09230945.asp"
Set objHTTP = CreateObject( "WinHttp.WinHttpRequest.5.1" )
objHTTP.Open "GET", strURL
objHTTP.Send
' Check if the result was valid, and if so return the result
If objHTTP.Status = 200 Then MyIP_WinHTTP = objHTTP.ResponseText
Set objHTTP = Nothing
End Function
