Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

[TuT]Website IP Grabber[VB.NET]

ffs. constantly tonight.

grr
I'll say what I said on your other "tutorial" thread: don't just tell people to copy and paste code.
You should be telling them what all the shit means.
Code
Try
Is trying to do something. It have to be followed by a catch or final. It can prevent exceptions and crash of your program, but using try/catch is taking huge memory, if you're using alot.

Code
If TextBox1.Text.Contains("http://") Then
Is Checking if the textbox is containing http://, if not, then it will convert it. The methode used here is really bad. It could have been done much simpler. With a simple string add.

Code
Dim iphe As IPHostEntry = Dns.GetHostEntry(TextBox1.Text.Replace("http://", String.Empty))
    TextBox2.Text = iphe.AddressList(0).ToString()
Is making the variable iphe, which is the variable for IPHostEntry. It is simply getting the entry, which is the ipaddresslist. The first ip in the addresslist is the network ip (Correct me, if I'm wrong). Is writing the ip into a string and then into the textbox2.
Code
Else
Is just an else to the if code for checking, if the textbox contains http://

Code
Dim iphe As IPHostEntry = Dns.GetHostEntry(TextBox1.Text)
    TextBox2.Text = iphe.AddressList(0).ToString()
Doing the same as the code above, but without http://. Reallt this is the worst ipcheck of websites I have seen.
Code
End If
Ending the check.
Code
Catch ex As Exception
Catching exception, if there was throwed any.
Code
MsgBox(ex)
Writing the exception into a messagebox.
Code
End Try
Ending the try.

Explained. Correct me, if I'm wrong.
um.. this has already been made.... and its the same code :s


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by whitemaskNov 10, 2014 10:38 AM 2 161 Nov 10, 2014 10:38 AM
Last Post: frawg
[.NET] by DotnetDeveloperMay 2, 2014 03:38 PM 18 655 May 2, 2014 03:38 PM
Last Post: SIM-1676753
[.NET] by MarketplaceDec 31, 2013 07:27 PM 33 5,161 Dec 31, 2013 07:27 PM
Last Post: Sajuuk