\'Download 100 byte og tag det der står i \"<title>Your IP: 255.255.255.255</title>\". ;)
\'--------------------------------- Form1 ---------------------------------
Private Declare Function InternetOpen Lib \"wininet\" Alias \"InternetOpenA\" (ByVal sAgent As String, ByVal lAccessType As Long, ByVal sProxyName As String, ByVal sProxyBypass As String, ByVal lFlags As Long) As Long
Private Declare Function InternetCloseHandle Lib \"wininet\" (ByVal hInet As Long) As Integer
Private Declare Function InternetReadFile Lib \"wininet\" (ByVal hFile As Long, ByVal sBuffer As String, ByVal lNumBytesToRead As Long, lNumberOfBytesRead As Long) As Integer
Private Declare Function InternetOpenUrl Lib \"wininet\" Alias \"InternetOpenUrlA\" (ByVal hInternetSession As Long, ByVal lpszUrl As String, ByVal lpszHeaders As String, ByVal dwHeadersLength As Long, ByVal dwFlags As Long, ByVal dwContext As Long) As Long
Private Sub Form_Load()
Dim hOpen As Long
Dim hFile As Long
Dim Ret As Long
Dim lPos As Long
Dim sBuffer As String
Dim YourIP As String
sBuffer = Space(100)
hOpen = InternetOpen(\"Your IP\", 1, vbNullString, vbNullString, 0)
hFile = InternetOpenUrl(hOpen, \"
http://www.myip.dk/\", vbNullString, ByVal 0&, &H80000000, ByVal 0&)
InternetReadFile hFile, sBuffer, 100, Ret
InternetCloseHandle hFile
InternetCloseHandle hOpen
lPos = InStr(1, LCase(sBuffer), LCase(\"Your IP: \"))
If lPos > 0 Then
lPos = lPos + Len(\"Your IP: \")
YourIP = Mid$(sBuffer, lPos, InStr(lPos, sBuffer, \"<\") - lPos)
End If
MsgBox YourIP
End Sub
\'--------------------------------- Form1 ---------------------------------
se mere: her
http://www.eksperten.dk/spm/87568