Sie sind nicht angemeldet.
aqua-freak
unregistriert
![]() |
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
Function getExternalIP () dim htmlResult htmlResult = ReturnHTML("[url]http://checkip.dyndns.org/")[/url] leftMark = instr(htmlResult, "Address: " ) + 9 rightMark = instr( htmlResult, "<br>") - 1 if rightMark > 0 Then 'grabs the IP getExternalIP = mid( htmlResult, leftMark, rightMark - leftMark) else getExternalIP = "ERROR" end if End Function Private Function ReturnHTML(sURL) Dim objXMLHTTP,HTML Set objXMLHTTP = CreateObject("Microsoft.XMLHTTP") objXMLHTTP.Open "GET", sURL, False objXMLHTTP.Send HTML = objXMLHTTP.responseBody Set objRS = CreateObject("ADODB.Recordset") objRS.Fields.Append "txt", 200, 45000, &H00000080 objRS.Open objRS.AddNew objRS.Fields("txt").AppendChunk HTML ReturnHTML = objRS("txt").Value objRS.Close Set objRS = Nothing Set objXMLHTTP = Nothing End Function |
-