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

.NET 

[TuT]Website IP Grabber[VB.NET]

Before i start, do not post anything bad or mean. This can be done in CMD, but its a easy tutorial on how to make a windows forms application that also does it. I take my time to make these for HackForums, the least you could do is not post anything mean/disrespectful :) Okay, now on to my tutorial...


Step One(The GUI)

Make a small GUI that looks like mine, And move on to step two.



Step Two(Coding The Button)

Make sure you have Imports System.Net On top of Public Class Form1

This is all copy+paste, so double click the button, and use this code..
.
Code
Try
            If TextBox1.Text.Contains("http://") Then
                Dim iphe As IPHostEntry = Dns.GetHostEntry(TextBox1.Text.Replace("http://", String.Empty))
                TextBox2.Text = iphe.AddressList(0).ToString()
            Else
                Dim iphe As IPHostEntry = Dns.GetHostEntry(TextBox1.Text)
                TextBox2.Text = iphe.AddressList(0).ToString()
            End If
        Catch ex As Exception
            MsgBox(ex)
        End Try



Thats all you need to do, i learned from t0fx from here, and i love him for it.



Debug and test it on Facebook. You should get this...
[Image: 162793fd4a658ebf9ed75ce47d4707fe.png]
Why would you take someone Else's code and just repost it?

I would say this has been posted 10 times already..
http://www.pulsecodes.info
Computer and Information Science major.
Information Technology Apprentice.
Freelance Programmer.
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.
(Jan 23, 2011 04:00 PM)laptopguy Wrote:  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.

He doesn't understand that code because he copy and pasted it himself.
http://www.pulsecodes.info
Computer and Information Science major.
Information Technology Apprentice.
Freelance Programmer.
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.
(Jan 23, 2011 05:09 PM)BaussHacker Wrote:  
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.
you are amazing :p id give rep, but i havent got approved for l33t membership yet. i purchased it not long ago.

thanks, 🙂

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 160 Nov 10, 2014 10:38 AM
Last Post: frawg
[.NET] by DotnetDeveloperMay 2, 2014 03:38 PM 18 654 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