by xyr0x (7 Submissions)
Category: Internet/HTML
Compatability: Visual Basic 4.0 (32-bit)
Difficulty: Unknown Difficulty
Originally Published: Tue 20th June 2006
Date Added: Mon 8th February 2021
Rating:
(1 Votes)
Gets Remote IP with 4 Lines of code, excluding from the new implementation of Error Handling! EASIEST WAY TO GET REMOTE IP now WITH ERROR
API Declarations
'Author: xyr0x
'Revised: June 18th, 2006
'Contact: [email protected]
'AIM: ixi xyr0x ixi
'MSN: [email protected]
'DONT RIP... LEARN From this. kthx.
'Revised: June 18th, 2006
'Contact: [email protected]
'AIM: ixi xyr0x ixi
'MSN: [email protected]
'DONT RIP... LEARN From this. kthx.
Private Sub MYIP_Click()
On Error Resume Next 'We don't want errors while processing the following 'procedure.
DoEvents ' Again do as we want to do but this is optional.
If Inet1.OpenURL Then 'if statements always end with a Else to be proper...
Call IPCon 'Calls IPCon to process the snippet which will obtain your Remote IP.
Else 'Else. This means if the If statement cannot be called, then, it'll refer 'to this, and call the next If, and so 'on.
If Inet1.RequestTimeout Then 'This statement is if your internet is connected, but can't connect to the 'PCHELPLIVE Website to obtain IP
Call NoCon 'Calls the NoCon sub routine, to execute a messagebox so you don't 'crash.
Else
If Inet1.StillExecuting Then 'This statement is incase a user is clicker friendly, so it doesn't Crash with "StillExecuting, which you can get on DoS (All Versions) My Bad...
Call BePatient 'Calls the BePatient sub routine, to execute a messagebox so you 'don't crash.
End If 'I used 3 If, Then, Else statements, which this requires Three End If statements to finish the sub 'routine
End If
End If
End Sub
Private Sub IPCon()
Dim rIP As String
rIP = Inet1.OpenURL("http://pchelplive.com/ip.php")
remoteip.Text = rIP
remoteip.Text = Replace(remoteip, Chr(10), "")
End Sub
'All of this is explained above, and if you don't understand it... why are you here?
Private Sub NoCon()
MsgBox "You currently are not connected to the internet.", vbInformation, "Remote IP"
End Sub
Private Sub BePatient()
MsgBox "Please wait until IP address has been Obtained!", vbExclamation, "Remote IP"
End Sub
No comments have been posted about Gets Remote IP with 4 Lines of code, excluding from the new implementation of Error Handling! EASIE. Why not be the first to post a comment about Gets Remote IP with 4 Lines of code, excluding from the new implementation of Error Handling! EASIE.